Bug/infelicity with System.Locale.iso8601DateFormat

Jon Fairbairn jon.fairbairn at cl.cam.ac.uk
Fri Nov 9 12:37:26 EST 2007

According to <http://www.w3.org/TR/NOTE-datetime> (and other
random sources), the iso format for date+time in one field
is YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00), ie
no spaces around the "T" but iso8601DateFormat outputs a
space after the day if the timeFmt is not Nothing, so

formatTime System.Locale.defaultTimeLocale
           (System.Locale.iso8601DateFormat (Just "T%H:%M:%SZ")) 
           (UTCTime (fromGregorian 2007 10 20) 26540)

yeilds "2007-10-20 T07:22:20Z".  I reckon this is a bug,
but at the very least it's not a good design.  Please can we

             Just fmt -> ' ' : fmt


             Just fmt -> fmt

?  if someone wants a space, they can put it in the string,
but it's a pain to take it out when you want the one field
format with a T there.

Jón Fairbairn                                 Jon.Fairbairn at cl.cam.ac.uk

More information about the Libraries mailing list