# dateFormat returns the wrong year

**URL:** <https://forum.inductiveautomation.com/t/dateformat-returns-the-wrong-year/41839>\
**Category:** Ignition\
**Created:** [December 29, 2020, 2:51pm UTC](https://forum.inductiveautomation.com/t/dateformat-returns-the-wrong-year/41839 "2020-12-29T14:51:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gpg](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gpg](https://forum.inductiveautomation.com/u/gpg)\
**Post date:** [December 29, 2020, 2:51pm UTC](https://forum.inductiveautomation.com/t/dateformat-returns-the-wrong-year/41839/1 "2020-12-29T14:51:02Z")

</div>

Just found out I had multiple tags report the wrong year (2021 instead of 2020)  
I was using  
dateFormat(now(),“YYYY-MM-dd”) will return 2021-12-29  
dateFormat(now(),“yyyy-MM-dd”) will return 2020-12-29

FYI  
Reason:

> <https://stackoverflow.com/questions/8686331/y-returns-2012-while-y-returns-2011-in-simpledateformat>

---

<div class="post-metadata">

**Author:** ![kcollins](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kcollins/32/19646_2.png) [@kcollins](https://forum.inductiveautomation.com/u/kcollins)\
**Post date:** [December 29, 2020, 3:01pm UTC](https://forum.inductiveautomation.com/t/dateformat-returns-the-wrong-year/41839/2 "2020-12-29T15:01:02Z")

</div>

There have been a few posts about this topic here in this last week of 2020. Thanks @gpg for linking this… I bet there are quite a few folks out there with this lurking syntax error–very interesting to learn about the reasoning behind it. The very next thing I checked was whether we have any hints in our documentation to key folks in on this, and thankfully it looks like both [`dateformat()`](https://docs.inductiveautomation.com/display/DOC81/dateFormat) expression function and [`system.date.format()`](https://docs.inductiveautomation.com/display/DOC81/system.date.format) call out the behavior on the _Week year_ format! 🕶
