Bug 497960 - can't set alarms by time when local timezone is UTC
Summary: can't set alarms by time when local timezone is UTC
Status: RESOLVED FIXED
Alias: None
Product: kalarm
Classification: Applications
Component: general (other bugs)
Version First Reported In: 3.10.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: David Jarvie
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-27 21:55 UTC by Esme Povirk
Modified: 2025-01-02 14:59 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 24.12.1
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Esme Povirk 2024-12-27 21:55:19 UTC
SUMMARY
With the system timezone set to UTC, when entering an alarm at a specific date/time, KAlarm always reports that the time has already elapsed.

STEPS TO REPRODUCE
1. Set localtime to UTC.
2. Select New>>New Display Alarm... in KAlarm
3. Ensure "At date/time" is selected, and move it forward an hour to make sure it's in the future.

OBSERVED RESULT
An error message is shown: "Alarm time has already expired"

EXPECTED RESULT
Alarm is successfully created.

SOFTWARE/OS VERSIONS
KAlarm: 3.10.0 (KDE Gear 24.12.0)
KDE Frameworks: 6.9.0
Qt: Using 6.8.1 and built against 6.8.1
Arch Linux (Xcb)
Build ABI: x86_64-little_endian-lp64
Kernel: linux 6.12.6-arch1-1

ADDITIONAL INFORMATION
I tracked this down to the offsetAtLocalTime function in kadatetime.cpp. The switch (qTimeSpec(zoneDateTime)) does not account for Qt::UTC or Qt::OffsetFromUTC. In this case, the timespec is QT::UTC.
Comment 1 David Jarvie 2025-01-02 14:59:26 UTC
Thank you for investigating and reporting this. It is now fixed for KAlarm version 3.10.1 (KDE Gear 24.12.1), commit e44424ad52e2875dea167da6a7db4e8b7f5e14c7.