The first thing that jumps out with mmdy is that you only have one character for day and one for year. How would it determine that it is the 11th day of the month in 2025? It should be MMDDYY, or for easier reading/less chance of error, DDMMMYYYY so the DD accepts numbers only, the MMM accepts letters like DEC and of course 4 digits for the year so you end up with something like 27NOV2025 which is not going to be confused for anything else (050411 requires the reader to remeber the format so they know if that is May 4 2011, April 5th 2011, April 11 2005 etc).
Huh?
Because date -[?|h|help] says so. (below were comments, but # on poal makes them big) D or M or Year can be short(long): Wed(ndesday)/#, Nov(ember), (20)25 Mon. D#, Y # Nov(ember) 19, (20)25 # Default: MDY Da Mon. D# # Wed(nesday), Nov(ember) 19 # DMD D# Mon. Y # 19 Nov(ember) (20)25 # DMY Da Mon. D# Y # Wed(nesday), Nov(ember) 19, (20)25 # DMDY Da D# Mon. Y # Wed(nesday), 19 Nov(ember) (20)25 # DDMY
I still need to write the help documentation with all the changes I've added, but that's simply just test so it's easy. I did it this way because those 5 collapse like 34 (I forge the exact #) different standard date notations. You can set a global long / short, or an individual time unit long / short;
Plus, I don't think people realize how actually complex text parsing is when you take that text to do something.
(post is archived)