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