delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/08/07/10:45:18

From: eplmst AT lu DOT erisoft DOT se (Martin Stromberg)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: problem with 'date' version 2.0j
Date: 7 Aug 2002 14:16:23 GMT
Organization: Ericsson Erisoft AB, Sweden
Lines: 29
Message-ID: <aira3n$pqb$1@antares.lu.erisoft.se>
References: <20020807123616 DOT GA1905 AT kendall DOT sfbr DOT org> <air920$p8v$1 AT antares DOT lu DOT erisoft DOT se>
NNTP-Posting-Host: lws256.lu.erisoft.se
X-Newsreader: TIN [version 1.2 PL2]
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

However there's either a bug in the program or in the
documentation. The documentation says the "--date" option shouldn't
affect "%s". "-d" is == "--date" (both documentally (Is there such an
English word?) and functionally). Hence ``date --utc "%s"'' and ``date
-d "Jan 1 1980" --utc "%s"'' should give the same result, but does
not:

> date --version
date (GNU sh-utils) 2.0j
Written by David MacKenzie.

Copyright (C) 2000 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There
is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
> date --utc "+%s"
1028736530
> date -d "Jan 1 1980" --utc "+%s"
315532800
> date "+%s"
1028736567
> date -d "Jan 1 1980" "+%s"
315532800


Right,

						MartinS

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019