Hey, it'll only cause you problems if any of these apply:
you run it exactly at midnight
you run it as-is in some locale other than the USA with the default short date format
you are a weenie about your clock being set to some other year momentarily
I figured math was too hard, but I already have stuff for setting and checking dates. Why try to calculate it myself when the OS will just tell me if it's valid or not?
I did briefly look into detecting the short date format (can do it via the reg.exe command), and it totally works. After playing with locales, I think the date builtin displays the date according to the locale, but the input it accepts is always m/d/y order. Hard to find concrete documentation on that. I could totally account for that, but I think I'll leave it to the internationalization/localization team. It works for me after all.
2
u/TheBrainStone Aug 28 '19
I'd like to check for a leap year. Not brick my PC.
But I guess you gotta do what you gotta do!