07-07-2022 10:01 AM
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.
07-07-2022 10:06 AM
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
07-07-2022 10:28 AM - edited 07-07-2022 10:29 AM
07-07-2022 10:38 AM
I've seen YYYYMMDD before too (just one long string), which would just be %<%Y%m%d>T.
07-07-2022 11:18 AM - edited 07-07-2022 11:25 AM
@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).
07-07-2022 12:28 PM
New version
07-07-2022 01:30 PM - edited 07-07-2022 01:34 PM
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… 😄
07-07-2022 02:09 PM
@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… 😄
07-07-2022 02:17 PM
@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.
07-07-2022 02:39 PM - edited 07-07-2022 02:44 PM
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. 😉