Re: RFC regarding usage of ISO 8601 throughout the tree

From: Ulrich Spörlein <uqs_at_spoerlein.net>
Date: Wed, 5 Jan 2011 20:47:49 +0100
On Wed, 05.01.2011 at 19:00:31 +0100, Julian H. Stacey wrote:
> Ulrich =?utf-8?B?U3DDtnJsZWlu?= wrote:
> > !ACHTUNG BIKESHED ALERT!
> > 
> > Hello,
> > 
> > With the recent changes to the committer graphs, I again was reminded
> > how much I hate the YYYY/MM/DD format (I can't help it ...). Given that
> 
> I guess & hope you mean you like linear decreasing order but 
> dislike '/' as a delimeter & want to swap from '/' to '-' as in ISO ?

Exactly.

> > this almost looks like ISO 8601, but is an unreadable variant of it, I
> > would like to aggressively change this throughout the tree.
> > 
> > I'd like to start with minor stuff like share/misc/*.dot. Then probably
> > src/UPDATING, and ports/UPDATING after I've identified the consumers of
> > these docs.
> 
> Do you mean you would like to swap eg src/UPDATING 20100720 to eg
> 2010-07-20  ?  That would be more readable.

Yes, I think for lists of dates like in UPDATING or automatically
generated date output like syslogd, the ISO8601 format only has
advantages.

> > The ultimate goal would be to change syslog's timestamp and ps(1)
> > output, but that goal is far off ...
> 
> I've long had a mental note to get round to fixing isnd which emits:
> 	"05.01.2011 13:15:06" 
> To 
> 	"2011-01-05 13:15:06"

Hehe, isdnd was written by a German, it seems :)

> However reading that URL, I see isdnd should have eg:
> 	2011-01-05T13:15:06
> 	2011-01-05T13:15:06+01:00
> 	2011-01-05T12:15:06Z
> But that 'T' is hard to see, so either space it (allowed by ISO)
> 	2011-01-05 13:15:06
> 	2011-01-05 13:15:06+01:00
> 	2011-01-05 12:15:06Z
> or lower case the 't' (if ISO allows ?)
> 	2011-01-05t13:15:06
> 	2011-01-05t13:15:06+01:00
> 	2011-01-05t12:15:06Z

I'd prefer the space to "T" or "t" for easier human parsing (and for
machine parsing it doesn't really matter)

> > http://en.wikipedia.org/wiki/ISO_8601
> > 
> > Uli
> 
> Week numbers in ISO standard can (& should IMO) be ignored:
> 	Not much use for week numbers in FreeBSD,
> 		Dates when source code is released, & /var/logs get
> 		stamped etc, best without week numbers, just
> 		simplistic linearly progressive continuously
> 		decremental digit format (ie Year Month Day Hour
> 		Minute Second
> 	Week numbers not used much, eg
> 		I'm British, lived in Germany 25 years. First I
> 		ever saw of week numbers was in Germany, never saw
> 		them in Britain.

Outside of cal/ncal I don't think we use week numbers anywhere in
FreeBSD.

> /usr/src/bin/date/
> 	Although default output of date eg
> 		Wed Jan  5 17:41:06 CET 2011
> 	is both non linear, & also non conformant in timezone (CET should
> 	be +01:00) it would open a can of worms to change default
> 	output, [unless it hangs on an env var.]  ...  [at least
> 	yet] ...  too many shells use it (in user's own code, not
> 	just in /usr/src & /usr/ports).
> 
> I don't see anything in `man date` to internaly emit timezone per ISO,
> this works:
> 	echo "`date -u +%Y-%m-%dt%H:%M:%S`Z"
> 	echo "`date -u +%Y-%m-%dt%H:%M:%S`+00:00"
> 	echo "`date -v-1H +%Y-%m-%dt%H:%M:%S`Z"		# (as my TZ is -01:00)
> but as that wouldnt do if nested inside more quotes from other shells,
> we could add to date.c to emit an explicit timezone,
> 2 flags to add, I suggest:
> 	- '-U' to force '-u' & also swap output of eg "CET 2011" to
> 	  "2011Z" or "2011+00:00"	 ( '-U' is not yet used ).
>  	- Some flag to specify a numeric string eg [+-][0-5][0-9]:[0-5][0-9]
> 	  (... maybe tie that in with man environ TZ tzset ? )

It's too late to change anything in date(1)'s default output, and it has
%F already via strftime(3) so people like me can already use that
everywhere.

Regards,
Uli
Received on Wed Jan 05 2011 - 18:47:52 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:10 UTC