Mail Archives: djgpp/2002/08/08/10:30:14
JT Williams <jeffw AT darwin DOT sfbr DOT org> wrote:
> Yes, that seems quite possible. Our time_t is 'unsigned int' and
> (according to `man types') my Solaris box typedef's it to 'long'. OTOH,
> ISTR having the same problem even without the "+%s" format,
'date' is essentially not much more than a (clever, humane) interface
to the <time.h> function, and time_t is the foundation of those. So
it should be expected that a value which doesn't fit in a time_t will
not work with 'date', either. Regardless of the time format used for
output.
> which might suggest that the type of time_t is not an issue (unless
> 'date' does some internal conversion elsewhere for which our time_t
> is a problem).
Furthermore, there seems to be a documentation error in that section you
quoted about +%s not being affected by a --date argument. Watch this, on
a Linux box near me:
~ $ date --date '2002-01-01' +'%s'
1009839600
~ $ date --date '2002-08-01' +'%s'
1028152800
Clearly, the outputs differ, i.e. %s does see the change of --date.
~ $ date --version
date (GNU sh-utils) 2.0
Written by David MacKenzie.
Copyright (C) 1999 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.
'info date' claims '%s' should not react to --date, but the manpage
doesn't. Seems the manpage is right, in this case.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -