After using it without issues, this macro now enters Next year:
%ICUDateTime%YYYYMMdd% --> 20211228
instead of 20201228
Any idea why?
After using it without issues, this macro now enters Next year:
%ICUDateTime%YYYYMMdd% --> 20211228
instead of 20201228
Any idea why?
You’ve run into a very common mistake: yyyy
and YYYY
are different.
Quoting: Use Format Strings to Specify Custom Formats:
A common mistake is to use
YYYY
.yyyy
specifies the calendar year whereasYYYY
specifies the year (of “Week of Year”), used in the ISO year-week calendar. In most cases,yyyy
andYYYY
yield the same number, however they may be different. Typically you should use the calendar year.
You’re welcome. I remember reading that a few years ago and thinking “I wonder how many people actually use YYYY
vs how many hours and hours of debugging have been spent trying to figure out why YYYY
was giving the ‘wrong’ year.”
I can’t imagine too many people actually needing what YYYY
does and I imagine most people always want what yyyy
does…
But:
Nobody asked me.
It’s probably too late to change it now.
I always think this to be in the ballpark of the GDP of a small country!