New Time format

Tim Rowe tim at eltig.freeserve.co.uk
Sun Jan 27 17:28:23 EST 2002


I agree that ISO8601 support should be built in as a standard format, but
the way you suggest it seems complicated and is incomplete -- what about
time-zone offset?

"Dale Strickland-Clark" <dale at riverhall.NOTHANKS.co.uk> wrote in message
news:e2m05u8aav0447b8lhg4il7qmergkmgdkk at 4ax.com...
> Pretty please can we have a new format method in the time module?
>
> There is an ISO standard date format, the order of which makes sense
> in most regions: year-month-day hour:minutes:seconds
>
> I propose:
>
> time.ISOtime(style)
>
> returns a strings the contents of which are determined by style.
>
> style = 0 => "hh:mm:ss"
> style = 1 => "yyyy-mm-dd"               (all numeric)
> style = 2 => "yyyy-mmm-dd"              (month localised TLA)
> style = 3 => "yyyy-mm-dd hh:mm:ss"      (all numeric)
> style = 4 => "yyyy-mmm-dd hh:mm:ss"     (month localised TLA)
>
> This would be a convenient format for use in output statements where
> you need the date but aren't too fussed about the appearance, so long
> as it isn't in the verbose confused order of time.asctime(). The guy
> who devised that format was on some disturbing medication. I hope he's
> feeling better now.
>
> What I'm after is something I can stick in code when I need a
> date/time without having to check the docs for the correct formatting
> sequence.
>
> --
> Dale Strickland-Clark
> Riverhall Systems Ltd





More information about the Python-list mailing list