Skip to content

Hyprsunset defaulting to UTC, ignoring system timezone #83

Description

@RNBermudez

Hello, I am not sure if this is an issue with Hyprsunset per se, but it and Hyprshot are the only two apps that show this behavior on both of my Arch Linux installs: the system timezone is ignored and they default to UTC (effectively 3 hours ahead of my local time).

System info that may be of relevance:

OS: Arch Linux
Kernel: 6.19.6-arch1-1
glibc: ldd (GNU libc) 2.43
gcc: g++ (GCC) 15.2.1 20260209
tzdata: 2026a-1
Hyprland: 0.54.1
Hyprsunset: v0.3.3

I am launching Hyrpland using uwsm.

The system timezone seems to be configured correctly as per Arch Wiki install guide:

❯ date
Sun Mar  8 10:31:27 AM -03 2026

❯ timedatectl
               Local time: Sun 2026-03-08 10:31:31 -03
           Universal time: Sun 2026-03-08 13:31:31 UTC
                 RTC time: Sun 2026-03-08 13:31:31
                Time zone: America/Argentina/Buenos_Aires (-03, -0300)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

❯ systemctl --user show-environment | rg TZ

❯ echo $TZ

❯ readlink -f /etc/localtime
/usr/share/zoneinfo/America/Argentina/Buenos_Aires

❯ stat /etc/localtime
  File: /etc/localtime -> /usr/share/zoneinfo/America/Argentina/Buenos_Aires
  Size: 50        	Blocks: 0          IO Block: 4096   symbolic link
Device: 259,3	Inode: 8397363     Links: 1
Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2026-03-08 09:55:02.077021557 -0300
Modify: 2026-03-08 09:55:02.076021464 -0300
Change: 2026-03-08 09:55:02.076021464 -0300
 Birth: 2026-03-08 09:55:02.076021464 -0300

❯ ls -l /etc/localtime
lrwxrwxrwx - root  8 Mar 09:55  /etc/localtime -> /usr/share/zoneinfo/America/Argentina/Buenos_Aires

❯ cmp /etc/localtime /usr/share/zoneinfo/America/Argentina/Buenos_Aires

What immediately stands out is that the $TZ variable is not set. The environment variables wiki entry does not mention that it should be added to ~/.config/uwsm/env-hyprland, but just for the sake of testing I did it anyway: export TZ="America/Argentina/Buenos_Aires".

This fixed Hyprlock, which according to its wiki entry would make some sense (it should still use the system clock):

$TIME and $TIME12 will use timezone from the TZ environment variable.
If it’s not set, the system timezone will be used, falling back to UTC in case of errors.

However, it did not fix Hyprsunset. I poked into the code (mind you, I am not a C++ developer myself, so take this with a grain of salt), and it seems that the current_zone() C++ function is used to fetch the timezone of the system. I compiled the small program included on that page, and as expected, it returned UTC as the timezone:

#include <chrono>
#include <iostream>
 
int main()
{
    try
    {
        const std::chrono::zoned_time cur_time
        {
            std::chrono::current_zone(), // may throw
            std::chrono::system_clock::now()
        };
        std::cout << cur_time << '\n';
    }
    catch(const std::runtime_error& ex)
    {
        std::cerr << ex.what() << '\n';        
    }
}
❯  ./test
2026-03-08 14:00:14.531910086 UTC

Tested with std::chrono::get_tzdb().current_zone() with the same output.

The way I "fixed" it, is by adding /etc/timezone file with the timezone (which seems to rarely used?):

echo "America/Argentina/Buenos_Aires" | sudo tee /etc/timezone
  • Is there something I am doing wrong?
  • Shouldn't this work with my current system settings?

I can´t help but think this is a C++ library problem, but it just so happens that every other program in my system runs fine.

Please let me know if there is anything I can do on my end to help.

Thanks.


Detailed info of the system and packages:

Details
❯ uname -a
Linux prontera 6.19.6-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 04 Mar 2026 18:25:08 +0000 x86_64 GNU/Linux

❯ bat /etc/os-release
─────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
     │ File: /etc/os-release
─────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1 │ NAME="Arch Linux"
   2 │ PRETTY_NAME="Arch Linux"
   3 │ ID=arch
   4 │ BUILD_ID=rolling
   5 │ ANSI_COLOR="38;2;23;147;209"
   6 │ HOME_URL="https://archlinux.org/"
   7 │ DOCUMENTATION_URL="https://wiki.archlinux.org/"
   8 │ SUPPORT_URL="https://bbs.archlinux.org/"
   9 │ BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
  10 │ PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
  11 │ LOGO=archlinux-logo
─────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

❯ ldd --version
ldd (GNU libc) 2.43
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

❯ g++ --version
g++ (GCC) 15.2.1 20260209
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

❯ pacman -Qi tzdata
Name            : tzdata
Version         : 2026a-1
Description     : Sources for time zone and daylight saving time data
Architecture    : x86_64
URL             : https://www.iana.org/time-zones
Licenses        : LicenseRef-tz
Groups          : None
Provides        : None
Depends On      : None
Optional Deps   : bash: for tzselect [installed]
                  glibc: for zdump, zic [installed]
Required By     : glibc  python
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 1681.84 KiB
Packager        : Andreas Radke <andyrtr@archlinux.org>
Build Date      : Mon 02 Mar 2026 04:24:14 PM -03
Install Date    : Sat 07 Mar 2026 07:52:11 PM -03
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature

❯ pacman -Qi glibc
Name            : glibc
Version         : 2.43+r5+g856c426a7534-1
Description     : GNU C Library
Architecture    : x86_64
URL             : https://www.gnu.org/software/libc
Licenses        : GPL-2.0-or-later  LGPL-2.1-or-later
Groups          : None
Provides        : None
Depends On      : linux-api-headers>=4.10  tzdata  filesystem
Optional Deps   : gd: for memusagestat
                  perl: for mtrace [installed]
Required By     : abseil-cpp  acl  alsa-lib  aom  appstream  aquamarine  at-spi2-core  attr  atuin  audit  avahi  ayatana-ido  base
                  bash  bat  binutils  bison  bluez  bluez-libs  bluez-utils  brotli  btop  bubblewrap  bzip2  c-ares  cairo  cairomm
                  cliphist  coreutils  cryptsetup  dav1d  dbus  dbus-broker  dconf  debugedit  desktop-file-utils  device-mapper
                  diffutils  double-conversion  duktape  efibootmgr  efivar  electron34  electron39  expat  eza  fakeroot  fastfetch  fd
                  ffmpeg  fftw  file  findutils  firefox  flac  flex  fmt  fontconfig  freetype2  fribidi  fuse2  fuse3  gawk  gcc-libs
                  gdbm  gdk-pixbuf2  gettext  giflib  git-delta  glib-networking  glib2  glibmm  glslang  glycin  gmp  gnupg  gnutls
                  gperftools  gpgme  gpsd  graphene  graphite  grep  groff  gsm  gssdp  gst-plugins-bad-libs  gst-plugins-base-libs
                  gstreamer  gtest  gtk-update-icon-cache  gtk3  gtk4  gtkmm3  gupnp  gupnp-igd  gzip  harfbuzz  highway  hyprcursor
                  hyprgraphics  hypridle  hyprland  hyprland-guiutils  hyprland-qt-support  hyprlang  hyprlock  hyprpaper  hyprpicker
                  hyprsunset  hyprtoolkit  hyprwire  icu  iniparser  iproute2  jansson  jbigkit  jq  json-c  json-glib  kbd  keyutils
                  kmod  krb5  l-smash  lame  leancrypto  less  libadwaita  libarchive  libasan  libass  libassuan  libasyncns  libatomic
                  libavc1394  libayatana-appindicator  libayatana-indicator  libb2  libbluray  libbpf  libbs2b  libbsd  libcap
                  libcap-ng  libcloudproviders  libcolord  libcups  libdaemon  libdatrie  libdbusmenu-glib  libdbusmenu-gtk3  libdeflate
                  libdisplay-info  libdovi  libdrm  libdvdnav  libdvdread  libebur128  libedit  libei  libelf  libepoxy  libevdev
                  libevent  libfdk-aac  libffi  libfontenc  libfreeaptx  libfyaml  libgcc  libgcrypt  libgfortran  libgit2  libgomp
                  libgpg-error  libgudev  libice  libimobiledevice  libimobiledevice-glue  libinih  libinput  libjpeg-turbo  libjxl
                  libksba  liblc3  libldac  libliftoff  liblsan  libmd  libmm-glib  libmnl  libmpc  libmpdclient  libndp  libnewt
                  libnfnetlink  libnghttp2  libnghttp3  libngtcp2  libnice  libnl  libnm  libnotify  libnsl  libnvme  libobjc  libogg
                  libopenmpt  libp11-kit  libpcap  libpciaccess  libpgm  libpipeline  libpipewire  libplacebo  libplist  libproxy
                  libpulse  libquadmath  libraw1394  librsvg  libsamplerate  libsasl  libseccomp  libsecret  libsigc++  libsm
                  libsndfile  libsodium  libsoup3  libspng  libssh  libstdc++  libstemmer  libtasn1  libtatsu  libteam  libthai
                  libtheora  libtiff  libtirpc  libtool  libtsan  libubsan  libunibreak  libunistring  libunwind  libusb  libusbmuxd
                  libutf8proc  libuv  libvdpau  libverto  libvorbis  libvpl  libvpx  libvterm  libwacom  libwebp  libwireplumber  libx11
                  libxau  libxcb  libxcomposite  libxcrypt  libxcursor  libxcvt  libxdamage  libxdmcp  libxext  libxfixes  libxfont2
                  libxft  libxi  libxinerama  libxkbcommon  libxkbcommon-x11  libxkbfile  libxml2  libxmlb  libxmu  libxrandr
                  libxrender  libxshmfence  libxslt  libxss  libxt  libxtst  libxv  libxxf86vm  libyaml  lilv  llhttp  lm_sensors  lmdb
                  lua51-lpeg  luajit  lz4  lzo  m4  make  man-db  md4c  mesa  minizip  mkinitcpio-busybox  mpdecimal  mpfr  msgpack-c
                  mtdev  muparser  ncurses  nettle  networkmanager  npth  nspr  nss  obsidian  ocl-icd  opencore-amr  openjpeg2  openssh
                  openssl  opus  orc  p11-kit  pacman  pam  pango  patch  pciutils  pcre  pcre2  perl  pinentry  pipewire
                  pipewire-audio  pipewire-jack  pixman  pkgconf  playerctl  polkit  popt  portaudio  procps-ng  pugixml  python-dbus
                  python-yaml  qt6-base  qt6-declarative  qt6-svg  qt6-wayland  rav1e  re2  readline  ripgrep  rtkit  rubberband  sbc
                  sdl2-compat  sdl3  sed  sequoia-sqv  serd  shaderc  shadow  shared-mime-info  slang  snappy  sord  spandsp  spdlog
                  spirv-tools  spotify-launcher  sqlite  sratom  srt  sudo  svt-av1  systemd-libs  tar  tinysparql  tomlplusplus  tree
                  tslib  unibilium  upower  util-linux  util-linux-libs  vid.stab  vim  vmaf  vulkan-icd-loader  vulkan-intel
                  vulkan-mesa-implicit-layers  waybar  wayland  webrtc-audio-processing-1  wget  which  wireplumber  wl-clipboard
                  wpa_supplicant  x264  x265  xcb-util  xcb-util-cursor  xcb-util-image  xcb-util-keysyms  xcb-util-renderutil
                  xcb-util-wm  xdg-desktop-portal  xdg-desktop-portal-hyprland  xdg-user-dirs  xorg-xkbcomp  xorg-xprop  xorg-xwayland
                  xvidcore  xxhash  xz  yazi  yyjson  zenity  zeromq  zimg  zix  zlib  zlib-ng  zoxide  zstd
Optional For    : tzdata
Conflicts With  : None
Replaces        : None
Installed Size  : 48.91 MiB
Packager        : Frederik Schwan <freswa@archlinux.org>
Build Date      : Mon 09 Feb 2026 08:31:58 AM -03
Install Date    : Fri 27 Feb 2026 08:53:46 PM -03
Install Reason  : Installed as a dependency for another package
Install Script  : Yes
Validated By    : Signature

❯ hyprsunset --version
hyprsunset v0.3.3

❯ hyprland --version
Hyprland 0.54.1 built from branch v0.54.1 at commit 4b07770b9ef1cceb2e6f56d33538aaffb9186b9c clean ([gha] Nix: update inputs).
Date: Tue Mar 3 21:06:41 2026
Tag: v0.54.1, commits: 6979

Libraries:
Hyprgraphics: built against 0.5.0, system has 0.5.0
Hyprutils: built against 0.11.0, system has 0.11.0
Hyprcursor: built against 0.1.13, system has 0.1.13
Hyprlang: built against 0.6.8, system has 0.6.8
Aquamarine: built against 0.10.0, system has 0.10.0

Version ABI string: 4b07770b9ef1cceb2e6f56d33538aaffb9186b9c_aq_0.10_hu_0.11_hg_0.5_hc_0.1_hlg_0.6
no flags were set

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions