Gerhard Lorbeer changed bug 1231174
What Removed Added
Summary std::chrono::zoned_time runtime error UTC computation incorrect

Comment # 3 on bug 1231174 from Gerhard Lorbeer
Sorry for wasting your time.

Linux version 6.11.0-1-default (geeko@buildhost) (gcc (SUSE Linux) 14.2.0, GNU
ld (GNU Binutils; openSUSE Tumbleweed) 2.43.1.20240828-2) #1 SMP
PREEMPT_DYNAMIC Wed Sep 25 07:09:20 UTC 2024 (b87e886)

I'm programming my home-automation in c++.
The program uses the std::chrono functions.
It uses functions computing my local time and the UTC-time; lights are turned
on/off at specific times. It's running since over 2 years without problems.
The timer was off during 16-28.09.2024 (vacation); until this point all was OK.
Turning on at 30.09.2024 i found failing calculation the UTC-time.

My guess is the patch timezone 2024b (29.09.2024).
"Do 12 Sep 2024 14:00:00 CEST Martin Schreiner <martin.schreiner@suse.com>"
justification below.

Because my program is very complex, i build an example to test, if it is an
program-bug or other not.
The simplest example i could build was the original example of cppreference.
I attached this example. Everyone can build this example and see the bug.

My originally problem was false computing of UTC/local:
so i build a further example to demonstrate
(from
https://www.heise.de/blog/Zeit-in-C-20-Details-zu-der-Arbeit-mit-Zeitzonen-9705367.html)

Output of the programm:
/home/gerhard/develop/Test2/build> /home/gerhard/develop/Test2/build/test2

UTC  time
  2024-10-01 15:00:53.451276556
  2024-10-01 15:00:53

Local time
  2024-10-01 15:00:53.451276556 UTC
  2024-10-01 15:00:53
  UTC offset: 0s

*** Beendet ***
you see "UTC offset: 0s"


i have a pc without patch "timezone". Here the output of the program:
UTC  time
  2024-10-01 15:24:49.078005857
  2024-10-01 15:24:49

Local time
  2024-10-01 17:24:49.078005857 CEST
  2024-10-01 17:24:49
  UTC offset: 7200s

you see the correct "UTC offset: 7200s"
at this unpatched pc the first program test runs correct even.


Thanks for your help.


You are receiving this mail because: