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

date bug?



Hi, 

Please take a look at the following, do you think it is bug of date?

$ date
Mon May 31 13:26:13 EDT 2010

$ date --date='1 month ago'
Sat May  1 13:24:20 EDT 2010

$ date --date='last month'
Sat May  1 11:09:21 EDT 2010

$ date --date='-1 month'
Sat May  1 13:26:49 EDT 2010

All above should give me some time in April, IMHO. (please disregard the 
time, I am copying/pasting from my execution history)

Same problem with "next month":

$ date --date='+1 month'
Thu Jul  1 13:29:23 EDT 2010

$ date --date='next month'
Thu Jul  1 11:07:31 EDT 2010

I was hoping to get June. 

Is it a bug, or there are other ways to get the correct answer?

Thanks

-- 
Tong (remove underscore(s) to reply)
  http://xpt.sourceforge.net/techdocs/
  http://xpt.sourceforge.net/tools/


Reply to: