[Top][All Lists]

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

date bug found

From: Poos_Krisztian
Subject: date bug found
Date: Fri, 30 Mar 2001 11:08:21 +0200 (CEST)


I think I have found a critical bug:) in tha date command.
I use (date --date '1 month ago') for plenty of my scripts, and there were
no problems till now. 
As I want to get the name of tha last month (February) from that output, I
realized that it gave me March. I tryed it from just the bash, and it was
the same. Here is the output:

address@hidden:~ > date
Fri Mar 30 10:53:48 CEST 2001
address@hidden:~ > date --date '1 month ago'
Fri Mar  2 10:53:55 CET 2001
address@hidden:~ > 

As you see, it makes its countdown with the previous month's number
of day, as it is here 28, and March 30 - 28 = March 2, so it does not work

So, I don't know, but there could be problem with that month, which has
31 or 30 days, because if you want the previous month in May, and date
works the same as in March, you could get May 1, because April has 30

Please check out, 

                                Thanks a lot, Krisztian Poos

reply via email to

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