[PYTHON DB-SIG] [comp.lang.python] Date-Time requirements (esp. for databases)

Anthony Baxter Anthony Baxter <arb@connect.com.au>
Thu, 31 Oct 1996 12:49:53 +1100

>>> Thomas Breuel wrote
> In the US, "/" pretty strongly suggest "month/day" order, while other
> delimiters ("-", ".") pretty strongly suggest "day-month" order (the
> year is unambiguous right now, either because it's 4 digits, or because
> it's too large to be a day or month).  In fact, if an Australian uses
> "/" in dates in business correspondence with the US, they will be
> misunderstood.  Complete lack of a delimiter (19961031) strongly
> suggests YMD order.

Sure, but we're talking about parsing dates in general. In a perfect world
we'd all just use YYYYMMDD and not have to worry about this. Ever tried
filling out a piece of paper for a non computer person with a date of
19961031? They get upset.

Hardcoding a parser to assume that the use of / as a delimeter means
"US M/D/Y" format would be very suboptimal. I can't see any alternative
apart from making it a switch as to which format you want.

> Of course, the least ambiguous way of writing dates is using three
> letter abbreviations for the month and four digit years (10 Jan 1996).
> I believe that, at least for the most common languages using Roman
> script, the months are unambiguous even if you don't know the language
> that the date was written in.

Sure, and when building systems this is something everyone should do. I'm
talking about parsing dates, generated by something that's not necessarily
within the control of the programmer.


DB-SIG  - SIG on Tabular Databases in Python

send messages to: db-sig@python.org
administrivia to: db-sig-request@python.org