bug-coreutils@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: "Eiríkur Hjartarson via GNU coreutils Bug Reports" <bug-coreutils@gnu.org>
To: 63349@debbugs.gnu.org
Subject: bug#63349: Bug in date when using UTC/GMT timeszones in the TZ variable
Date: Sun, 7 May 2023 13:28:28 +0000	[thread overview]
Message-ID: <9b9edd96-76ce-234f-2500-0d46b2e0c531@inan.is> (raw)

Hi,

I'm on Fedora-38 GNU/Linux and the version string of 'date' is "date 
(GNU coreutils) 9.1".

$ ls -l /etc/localtime
lrwxrwxrwx. 1 root root 40 jan 11  2022 /etc/localtime -> 
../usr/share/zoneinfo/Atlantic/Reykjavik

Now the "bug":

$ TZ=Europe/Riga date --iso-8601=minutes -d "2024-01-01T00:00-05:00"
2024-01-01T07:00+02:00

$ TZ=UTC+2 date --iso-8601=minutes -d "2024-01-01T00:00-05:00"
2023-01-01T03:00-02:00

That is: the first command gives me the time and date in Riga when it's
midnight at new year's eve in New York.

The second command should do the same but instead gives the time in 
Godthab Greenland.

$ TZ=America/Godthab date -d "2024-01-01T00:00-05:00" --iso-8601=minutes
2024-01-01T03:00-02:00

It seems to me that the sign in the timezone variable could be simply 
reversed.

Regards,
-- 
Eiríkur




             reply	other threads:[~2023-05-07 13:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-07 13:28 Eiríkur Hjartarson via GNU coreutils Bug Reports [this message]
2023-05-07 14:52 ` bug#63349: Bug in date when using UTC/GMT timeszones in the TZ variable Andreas Schwab
2023-05-07 16:36   ` Paul Eggert
2023-05-07 16:58   ` Eiríkur Hjartarson via GNU coreutils Bug Reports

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-coreutils

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9b9edd96-76ce-234f-2500-0d46b2e0c531@inan.is \
    --to=bug-coreutils@gnu.org \
    --cc=63349@debbugs.gnu.org \
    --cc=eiki@inan.is \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).