bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in GNU date (1.16): Doesn't handle DST shifts (GAWK gets it right!)


From: Kenny McCormack
Subject: Bug in GNU date (1.16): Doesn't handle DST shifts (GAWK gets it right!)
Date: 16 Nov 2001 20:02:31 -0600

Observe:

% gdate --version
date (GNU sh-utils) 1.16
% echo $TZ
US/Eastern
% gdate ; gdate -d '2400 hours ago'
Fri Nov 16 20:48:14 EST 2001
Wed Aug  8 20:48:14 EDT 2001
%

Now, it doesn't take a rocket scientist to realize that 2400 hours ago, it
was 20:48 EST (aka, 21:48 EDT).  So, how come it doesn't display it
correctly? (Either 20:48 EST or 21:48 EDT would be correct, but 20:48 EDT
is clearly wrong)

Fixed in a later version?

P.S.  Note that gawk's strftime() function gets this right.  Observe:

% gdate +%s
1005962243
% gawk 'BEGIN {print strftime("%c",1005962243)}'
Friday November 16 20:57:23 2001
% gawk 'BEGIN {print strftime("%c",1005962243-2400*3600)}'
Wednesday August 08 21:57:23 2001
%




reply via email to

[Prev in Thread] Current Thread [Next in Thread]