GNU bug report logs - #36383
date command processes timezone differently when doing math

Previous Next

Package: coreutils;

Reported by: Brian Woods <bpwoods <at> gmail.com>

Date: Tue, 25 Jun 2019 23:23:02 UTC

Severity: normal

Tags: notabug

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Brian Woods <bpwoods <at> gmail.com>
To: 36383 <at> debbugs.gnu.org
Subject: bug#36383: date command processes timezone differently when doing math
Date: Tue, 25 Jun 2019 16:10:07 -0700
[Message part 1 (text/plain, inline)]
When doing a math operation to a date command it appear to process the
timezone differently.

The system is Ubuntu 18.04.2 LTS.
Versions: coreutils/bionic,now 8.28-1ubuntu1 amd64 [installed]

#echo $datNow
2019-06-25 15:21:34

#date -d "$datNow " "+%Y-%m-%d %H:%M:%S" --debug
date: parsed date part: (Y-M-D) 2019-06-25
date: parsed time part: 15:21:34
date: input timezone: system default
date: using specified time as starting value: '15:21:34'
date: starting date/time: '(Y-M-D) 2019-06-25 15:21:34'
date: '(Y-M-D) 2019-06-25 15:21:34' = 1561501294 epoch-seconds
date: timezone: system default
date: final: 1561501294.000000000 (epoch-seconds)
date: final: (Y-M-D) 2019-06-25 22:21:34 (UTC)
date: final: (Y-M-D) 2019-06-25 15:21:34 (UTC-07)
2019-06-25 15:21:34

#date -d "$datNow + 1 minute" "+%Y-%m-%d %H:%M:%S" --debug
date: parsed date part: (Y-M-D) 2019-06-25
date: parsed time part: 15:21:34 UTC+01
date: parsed relative part: +1 minutes
date: input timezone: parsed date/time string (+01)
date: using specified time as starting value: '15:21:34'
date: starting date/time: '(Y-M-D) 2019-06-25 15:21:34 TZ=+01'
date: '(Y-M-D) 2019-06-25 15:21:34 TZ=+01' = 1561472494 epoch-seconds
date: after time adjustment (+0 hours, +1 minutes, +0 seconds, +0 ns),
date:     new time = 1561472554 epoch-seconds
date: timezone: system default
date: final: 1561472554.000000000 (epoch-seconds)
date: final: (Y-M-D) 2019-06-25 14:22:34 (UTC)
date: final: (Y-M-D) 2019-06-25 07:22:34 (UTC-07)
[Message part 2 (text/html, inline)]

This bug report was last modified 5 years and 325 days ago.

Previous Next


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