bug#63349: Bug in date when using UTC/GMT timeszones in the TZ variable

2023-05-07 Thread Eiríkur Hjartarson via GNU coreutils Bug Reports



On 7.5.2023 14:52, Andreas Schwab wrote:

On Mai 07 2023, Eiríkur Hjartarson via GNU coreutils Bug Reports wrote:


Now the "bug":


It's not a bug.


Thanks for the explanation, in my defense, I did read the date info page 
and the FAQ at https://www.gnu.org/software/coreutils/faq/coreutils-faq.html

.

Obviously I missed the reference to opengroup.

Regards,
--
Eiríkur





bug#63349: Bug in date when using UTC/GMT timeszones in the TZ variable

2023-05-07 Thread Eiríkur Hjartarson via GNU coreutils Bug Reports

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