New Year 2016 Seems to Have Broken {Date|YYYY-MM-dd}

I have a large number of directory creation functions that use this expression to create folder names that begin with the date of creation in YYYY-MM-DD order. Everything has been fine throughout 2014/15. Then, yesterday morning the year continues to be returned as 2015!

In other words, with the system date at 01-JAN-2016 (yesterday), the expression {Date|YYYY-MM-dd} returned 2015-01-01, and this morning (02-JAN-2016) it returns 2015-01-02.

I have tried this on two systems and the result is the same. The system clock is correct. OS is Windows 10 with the latest service packs etc applied.

Change your uppercase YYYY to lowercase yyyy.

YYYY is the ISO year, which won't change for a few more days, until the first week of the year as ISO defines it.

yyyy is the conventional year.

(Codes for date and time)

Thanks. I just discovered that myself by a circuitous route of trial and error. I must have learned the date formatting originally from a code example because the documentation shows the date codes clearly. But, honestly, I had never heard of the ISO Date before!

You learn something new every day!

btw On the subject of picking up the codes from an example, did you look at the very first paragraph of the section referred to by the link you provided?

"The following codes are used to pass formatted date and time strings to external programs. They are also quite often used to pass date strings to the internal commands - for example, to create a folder named after the current date, you might use a command like CreateFolder {date|YYYYMMdd}."

Personally, and I know it's way too late to change this now, I would have preferred a more explicit ISO year placeholder like maybe using the letter I.

Anyway, thanks again for the response.

The date format codes are defined by Windows itself, not something we created.

Thanks for pointing out the example. We'll get that changed to the more usual thing people would want.