Ign v7.8.5 date format issue SOLVED

I had a yesterdays date expression tag, that was grabbing date now, minus 1 day via the datearitmetic then using dateformat() to make it yyyyMMdd. beow is the expression:
dateformat(dateArithmetic(now(), -1, “days”), “YYYYMMdd”)

today it gave me 20181231, which obviously is a year in advance.

I found that instead changing the format string and removing the dateformat command helped, but so did using lower case yyyy rather than YYYY in the dateformat command. likewise if you use capital YYYY in the date format string it also gives you 2018 instead of 2017.

I figured this was a good one to share, as i hadnt seen it yet on the forum.

happy new year

The difference in behavior of lowercase y and uppercase Y is pretty clearly documented here for v7.9 and here for v7.8. It corresponds to the system for counting weeks of a year (format code lowercase w).

thanks for the heads up. That caught me earlier and I made a workaround until I could find the issue tomorrow.

i did not notice this before thank you