I have an action that sets date and time to 1hr after the current time. It worked very well. But recently (maybe since upgrading to Big Sur), the Year becomes 2021, which is the next year, not this year. Can anyone explain why and how to fix it?
Thanks!
This is the code: %ICUDateTimeFor%NOW() + 3600%YYYY-MM-dd%T%ICUDateTimeFor%NOW() + 3600%HH:mm:ss%
(I added 3600s because I want to set the default time to 1hr after the current time.)
’tis the season… when people realize that YYYY and yyyy are different.
Long story short, you want yyyy not YYYY. They are the same except for the first week in January and last week in December, where they are (sometimes) different.
(This isn’t Keyboard Maestro’s fault, BTW, the actual specification has this distinction in it, which I find absurd and can’t imagine anyone actually wanting to use, but nobody asked my opinion before they implemented it.)
A common mistake is to use YYYY. yyyy specifies the calendar year whereas YYYY specifies the year (of “Week of Year”), used in the ISO year-week calendar. In most cases, yyyy and YYYY yield the same number, however they may be different. Typically you should use the calendar year.
wow~
Thanks!
Indeed I did not know there is a difference in "YYYY" and "yyyy".
Now I can also see that KM wiki page also has a footnote on it, which says
There might be, but I wouldn’t worry about it. Maybe someone in the future will find this post (or the forum software will show it as recommended) when they would have missed the other one, and vice versa.
It’s one thing to have two long separate threads about the same issue, but I don’t think this is one of those cases. IMO.