1
0
Fork
You've already forked console-clock
0

Take into account timezone information changes #1

Open
opened 2026年06月10日 10:03:11 +02:00 by dimich · 0 comments

There are two variants how timezone may change:

  1. User changed /etc/localtime symlink target.
  2. tzdata file content changed due to software upgrade.

Options to implement the handling:

  • Call tzset() every time before conversion to local time
    Cons:

    • In "minute" mode changes are applied only for next minute.
    • Doesn't seem to work for 2nd variant of change (TODO: research).
    • Extra syscall for each tick even if timezone info is not changed.
  • Watch /etc/localtime and/or tzfile changes with inotify(7).
    Cons:

    • Need to replicate glibc behavior for case when TZ variable is set.
    • Need to track full tzdata file path: any component of the path may change.
  • Watch org.freedesktop.timedate1 D-Bus property changes (TODO: research).
    Cons:

    • Limited to freedesktop.org compliant systems.
    • Depends on D-Bus and systemd service.
  • Trigger tzfile re-read externally from package manager hook and timezone selection tools.
    Cons:

    • Specific to package manager.
    • "Timezone selection tools" is a vague concept.
There are two variants how timezone may change: 1. User changed `/etc/localtime` symlink target. 2. tzdata file content changed due to software upgrade. Options to implement the handling: * Call `tzset()` every time before conversion to local time Cons: - In "minute" mode changes are applied only for next minute. - Doesn't seem to work for 2nd variant of change (TODO: research). - Extra syscall for each tick even if timezone info is not changed. * Watch `/etc/localtime` and/or tzfile changes with inotify(7). Cons: - Need to replicate glibc behavior for case when `TZ` variable is set. - Need to track full tzdata file path: any component of the path may change. * Watch `org.freedesktop.timedate1` D-Bus property changes (TODO: research). Cons: - Limited to freedesktop.org compliant systems. - Depends on D-Bus and systemd service. * Trigger tzfile re-read externally from package manager hook and timezone selection tools. Cons: - Specific to package manager. - "Timezone selection tools" is a vague concept.
dimich changed title from (削除) Update time on timezone change (削除ここまで) to Take into account timezone information changes 2026年06月11日 04:16:00 +02:00
Sign in to join this conversation.
No Branch/Tag specified
master
experiment/goto
experiment/fsm
original
No results found.
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dimich/console-clock#1
Reference in a new issue
dimich/console-clock
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?