[phobos] datetime review (new attempt at URL)

Michel Fortin michel.fortin at michelf.com
Thu Oct 14 13:46:38 PDT 2010


On 2010-10-14, at 16:17, Steve Schveighoffer wrote:

> Yes, it is.  But at the end of the day, without including a gigantic locale 
> library, we need to standardize on a simple way of printing dates and times for 
> debugging (i.e. via toString).  My suggestion is simply to pick one and say 
> "this is it, if you want something different, use a locale library".  I'd prefer 
> it to be my locale, but as long as it's *something*, it should be fine.

If you have to pick one, please pick an ISO-compilant one, like YYYY-MM-DD hh:mm:ss.fff. It's the least ambiguous format, is pretty readable, and as a bonus you can sort them as strings to put them in chronological order. Beside, this ordering of date components is used for SQL, HTML5, and the xs:dateTime base type for XML schemas, and probably many other places.

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/





More information about the phobos mailing list