[1286] in linux-security and linux-alert archive
Re: date error
daemon@ATHENA.MIT.EDU (Kevin J. Cummings )
Sun Nov 10 18:57:11 1996
Date: Thu, 31 Oct 96 11:52 EST
From: cummings@kjc386.framingham.ma.us (Kevin J. Cummings )
To: linux-security@redhat.com
In-Reply-To: Mail from 'M Shariful Anam <shuman@triton.kaifnet.com>'
dated: Thu, 31 Oct 1996 18:04:45 +0600 (GMT+0600)
Resent-From: linux-security@redhat.com
Reply-To: linux-security@redhat.com
> I was using the --date feature of date command. This is what I got:
> date --date '0 month ago' gives correct current date time
> date --date '2 months ago' gives correct 2 months ago date time
>
> date --date '1 month ago' gives correct time, month, day BUT 1970!
>
> Why is this?
date --date '1 month ago'
Wed Dec 31 11:59:59 EST 1969
Looks like a bug to me, then again, Spetember didn't have 31 days! I get the
same answer if I ask it to go back to any month with 28, 29, or 30 days in it!
[REW: This discussion was held "behind the scenes", and I didn't
believe it until I realized that this was "date" related (I had to put
my date back on my computer to reproduce this). It is security related
if you use this date command to e.g. select a set of files to be
backed up or removed.... Anyway, I'd want the date command to give me
either the closest guess or no output on stdout and an error on
stderr....]
kc