I want to decode date strings from a variety of different formats. Of course not all date strings are unambiguous; but I want to handle a reasonable range of possibilities.
Here's what I've come up with:
Suggestions appreciated.
This poses a new risk, many dates match more than one format, for example, 7/4/06 - this could be 7 Apr 2006 or 4 July 2006 or 6 Apr 2007 based on the user's location
I've seen YYYYMMDD before too (just one long string), which would just be %<%Y%m%d>T.
@GerdW wrote:
Hi Paul,
you forgot:
- dd.mm.yy(yy) (or mm.dd.yy(yy)) formats using points as separators
- dd. %b yy(yy) format (you might get into trouble with foreign language month names)
- ISO8601 formatted timestamps…
- …
I don't want to encourage anyone to use dotted formats (for dates and phone numbers).
New version
Hi Paul,
@paul_cardinale wrote:
I don't want to encourage anyone to use dotted formats (for dates and phone numbers).
But exactly those are standard in Central Europe! (Well, atleast for dates. Never seen phone numbers using dots.)
Tomorrow is 08.07.2022 for me…
With a big grin: when asking a worldwide forum for opinions you should not reject worldwide suggestions because of an US point of view…
@GerdW wrote:
Hi Paul,
@paul_cardinale wrote:
I don't want to encourage anyone to use dotted formats (for dates and phone numbers).But exactly those are standard in Central Europe! (Well, atleast for dates. Never seen phone numbers using dots.)
Tomorrow is 08.07.2022 for me…
With a big grin: when asking a worldwide forum for opinions you should not reject worldwide suggestions because of an US point of view…
@Frozen wrote:
@GerdW wrote:
Hi Paul,
@paul_cardinale wrote:
I don't want to encourage anyone to use dotted formats (for dates and phone numbers).But exactly those are standard in Central Europe! (Well, atleast for dates. Never seen phone numbers using dots.)
Tomorrow is 08.07.2022 for me…
With a big grin: when asking a worldwide forum for opinions you should not reject worldwide suggestions because of an US point of view…
NOTE: The following comment is entirely tongue-in-cheek
Yeah, but as an American, I feel obliged to not care
On a more serious note, I do prefer YYYY-MM-DD because it makes sorting a lot easier.
Hi,
@crossrulz wrote:On a more serious note, I do prefer YYYY-MM-DD because it makes sorting a lot easier.
Me too!
(There's a reason why I mentioned ISO8601 in message #3…)
@crossrulz wrote:
Yeah, but as an American, I feel obliged to not care
Yes, I know.