[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

a human-eye date format everyone can love

From: Ask Bjoern Hansen <ask_at_develooper.com>
Date: 2002-06-25 12:11:40 CEST

If saving space is a big concern, a few characters could be saved by
omitting the -'s and the :'s.

Something like

$ date +'%Y%m%dT%H%M%S%z'
20020625T030551-0700

Would be the most compact ISO 8601 way to tell the time right now in
my timezone, I believe. But not all that readable.

Bending the rules slightly and substituting the T with a space helps
quite a bit.

$ date +'%Y%m%d %H%M%S%z'
20020625 030710-0700

But I doubt it's worth saving 4 characters for. :)

$ date +'%Y-%m-%d %H:%M:%S%z'
2002-06-25 03:08:33-0700

Specifying the timezone as a two digit number is valid, if I am not
mistaken, but I agree with the earlier participants in this round of
bikeshedding ( :-) ) that it makes it significantly harder to read.

If the timezone is UTC, it might make sense to print that as

$ date +'%Y-%m-%d %H:%M:%SZ'
2002-06-25 03:09:59Z

Thanks for listening. :)

 - ask (who thinks having just the weekday in the second part would
        be just fine)

-- 
ask bjoern hansen, http://askbjoernhansen.com/ !try; do();
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jun 25 12:12:06 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.