GNU bug report logs - #11115
linux date arithmetic

Previous Next

Package: coreutils;

Reported by: Stefan Karamuz <stefan <at> karamuz.pl>

Date: Wed, 28 Mar 2012 17:59:02 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Karamuz <stefan <at> karamuz.pl>
To: bug-coreutils <at> gnu.org
Subject: linux date arithmetic
Date: Wed, 28 Mar 2012 14:39:11 +0200
[Message part 1 (text/plain, inline)]
Please check the 2 linux commands:

date -d "$(date +%F\ %H:%M:%S)" +%F\ %H:%M:%S
date -d "$(date +%F\ %H:%M:%S) + 1 minute" +%F\ %H:%M:%S

It's very confusing, because the results of the two commands differ in 
one hour and one minute, except of one minute only.

[~]$ date -d "$(date +%F\ %H:%M)" +%F\ %H:%M:%S
2012-03-28 14:06:00

... and after a few seconds:

[~]$ date -d "$(date +%F\ %H:%M:%S) + 1 minute" +%F\ %H:%M:%S
2012-03-28 15:07:20

It's a bug or I don't understand something?

The systems tested include:

Fedora 16
Centos 6.2
Debian *6.0.4

*Best Regards,

    Stefan Karamuz










[Message part 2 (text/html, inline)]

This bug report was last modified 6 years and 218 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.