in reply to Re^2: Human-readable date format strings
in thread Human-readable date format strings
Why use an array and not a hash?
Because the order matters. If the regex checked for 'yy' before 'yyyy', then 'yyyy-mm-dd' would translate to '%y%y-%m-%d'.
You are missing...
I can only do what the POSIX standard supports. Thanks for the translation suggestions, they are easy enough to add.
What do you do with "yyy"? Leave it as is?
Like POSIX::strftime(), anything not recognized as a formatting element is left as-is, yes (although 'yyy' in specific would translate to '%yy'). Unlike strftime(), I didn't add an escape sequence in case you wanted a literal 'yy' in the string. Exercise for the user I guess. :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Human-readable date format strings
by Tux (Canon) on Oct 21, 2014 at 09:43 UTC | |
by choroba (Cardinal) on Oct 21, 2014 at 11:48 UTC |