[buug] ISO date format

Rick Moen rick at linuxmafia.com
Thu Jan 17 20:31:10 PST 2013


Quoting Michael Paoli (Michael.Paoli at cal.berkeley.edu):

> or additionally, on systems with GNU date[3]:
> $ date -I
> 2013-01-17

I'm feeling like I've just gone through a time warp to March 2007, when
this whole subject was discussed to death on Don Marti's linux-elitists
mailing list -- including the reason why the above is a bad idea.
Quoting part of that thread:

   From rick Sat Mar  3 21:56:53 2007
   Date: Sat, 3 Mar 2007 21:56:54 -0800
   To: linux-elitists at zgp.org
   Subject: Re: [linux-elitists] Show Us The Code

   Quoting David L. Anselmi (anselmi at anselmi.us):
 
   > The Debian bug on this says that --iso-8601 is deprecated in favor of
   > --rfc-3339 and contains links to the upstream discussion:
   >
   > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=354799
   >
   > Be nice if there were a short option, I guess.

   '-I' is now deprecated (and deliberately dropped from the manpage, which
   seems bloody minded) for the same reason that --iso-8601 was.  Option
   -i was proposed as a replacement short option (standing for 'Internet
   time'), but rejected because Paul Eggert's PC clock was too jittery
   (http://lists.gnu.org/archive/html/bug-coreutils/2005-09/msg00056.html).
 
   So, the best approximation we'll be permitted to the brevity and clarity
   of 'date -I' is
 
     date +%Y-%m-%d
   or
     date --rfc-3339=date

   Argh.  Just kill me now.

So, sorry, no, you really should _not_ recommend 'date -I' to people using
GNU date, because the GNU coreutils people have already telegraphed their
intention to drop that option from future versions.

After the aforementioned linux-elitists thread, I figured out a
reasonable alternative (for GNU date users) that is _not_ similarly
destined to be dropped into the dustbin:

date +%F



> At the last (2012-01-03) BUUG meeting, among other things discussed,
> date and date/time format came up.  I mentioned ISO[1] date format....

I believe you mean ISO 8601 format.


> And yes, I've at least occasionally made earlier mention[4] of ISO date
> format.
> 4. http://lists.balug.org/pipermail/balug-talk-balug.org/2010-February/004557.html

And I told you about 'date +%F' at that time, too, in my immediate follow-up:
http://lists.balug.org/pipermail/balug-talk-balug.org/2010-February/004559.html

-- 
Cheers,             A programmer had a problem. He thought to himself, "I know,
Rick Moen           I'll solve it with threads!".  has Now problems. two he
rick at linuxmafia.com                                        -- Davidlohr Bueso 
McQ! (4x80)


More information about the buug mailing list