# system.date.getDayOfMonth unexpected output

**URL:** <https://forum.inductiveautomation.com/t/system-date-getdayofmonth-unexpected-output/101808>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [February 4, 2025, 12:11am UTC](https://forum.inductiveautomation.com/t/system-date-getdayofmonth-unexpected-output/101808 "2025-02-04T00:11:12Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 4, 2025, 12:21am UTC](https://forum.inductiveautomation.com/t/system-date-getdayofmonth-unexpected-output/101808/2 "2025-02-04T00:21:43Z")

</div>

Time to play 'spot the difference':

```python
startDate = system.date.parse('2024-01-01 00:00:00', 'yyyy-MM-dd HH:mm:ss')
endDate = system.date.parse('2025-01-01 00:00:00', 'yyyy-MM-dd HH:mm:ss')

print system.date.yearsBetween(startDate, endDate)
print system.date.getSecond(startDate) == system.date.getSecond(endDate)
print system.date.getMinute(startDate) == system.date.getMinute(endDate)
print system.date.getHour24(startDate) == system.date.getHour24(endDate)
print 'about to print dayOfMonth...'
print system.date.getDayOfMonth(startDate) 
print system.date.getDayOfMonth(endDate)
print 'just printed dayOfMonth'
print system.date.getMonth(startDate) == system.date.getMonth(endDate)
print system.date.yearsBetween(startDate, endDate) == 0

```

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/6/163efe8506b595c7baabb40f6473068c050d5649.png)

`YYYY` in `system.date.parse` gives you the 'ISO week year', _not_ the expected calendar year - `yyyy` is what you actually want.

[![](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/6/f6d53453c99ff042095fb320f7567456bdd7c50d.jpeg "Why 2020 Started On December 30th") ](https://www.youtube.com/watch?v=D3jxx8Yyw1c)

---

_[View the full topic](https://forum.inductiveautomation.com/t/system-date-getdayofmonth-unexpected-output/101808)._
