bug-coreutils
[Top][All Lists]
Advanced

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

bug#17161: Bug in date arithmetic of date


From: Marc R.J. Brevoort
Subject: bug#17161: Bug in date arithmetic of date
Date: Tue, 1 Apr 2014 13:30:16 +0200 (CEST)
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)

Hi,

There seems to be some weirdness in date arithmetic when dates
include a time stamp (and all provided in ISO formatting):

Correct:

address@hidden:~$ date -d "2014-03-11" +"%Y-%m-%d %H:%M:%S"
2014-03-11 00:00:00

address@hidden:~$ date -d "2014-03-11 -1 day" +"%Y-%m-%d %H:%M:%S"
2014-03-10 00:00:00

Incorrect:

address@hidden:~$ date -d "2014-03-11 12:34 -2 hours" +"%Y-%m-%d %H:%M:%S"
2014-03-11 15:34:00
address@hidden:~$ date -d "2014-03-11 12:34 +2 hours" +"%Y-%m-%d %H:%M:%S"
2014-03-11 11:34:00
address@hidden:~$ date -d "2014-03-11 12:34 -1 day" +"%Y-%m-%d %H:%M:%S"
2014-03-12 13:34:00
address@hidden:~$ date -d "2014-03-11 12:34 +1 day" +"%Y-%m-%d %H:%M:%S"
2014-03-12 11:34:00






reply via email to

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