Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ingmarioalberto/def7a154659a311c3908a1d2f0adaaaa to your computer and use it in GitHub Desktop.
Save ingmarioalberto/def7a154659a311c3908a1d2f0adaaaa to your computer and use it in GitHub Desktop.
Show DST / Disable DST
zdump -v America/Mexico_City | grep $(date +"%Y")
America/Mexico_City Sun Apr 4 07:59:59 2021 UT = Sun Apr 4 01:59:59 2021 CST isdst=0 gmtoff=-21600
America/Mexico_City Sun Apr 4 08:00:00 2021 UT = Sun Apr 4 03:00:00 2021 CDT isdst=1 gmtoff=-18000
America/Mexico_City Sun Oct 31 06:59:59 2021 UT = Sun Oct 31 01:59:59 2021 CDT isdst=1 gmtoff=-18000
America/Mexico_City Sun Oct 31 07:00:00 2021 UT = Sun Oct 31 01:00:00 2021 CST isdst=0 gmtoff=-21600
-------------------
To remove DST settings you have to know your time shift and reverse it, so for example
for America/Mexico_City being it: -6
```
# rm -f /etc/localtime && ln -s /usr/share/zoneinfo/Etc/GMT+6 /etc/localtime
# timedatectl
Local time: Wed 2023-03-08 13:14:49 -06
Universal time: Wed 2023-03-08 19:14:49 UTC
RTC time: Wed 2023-03-08 19:14:52
Time zone: Etc/GMT+6 (-06, -0600)
System clock synchronized: no
NTP service: active
RTC in local TZ: no
```
rollback:
```
# rm -f /etc/localtime && ln -s /usr/share/zoneinfo/America/Mexico_City /etc/localtime && timedatectl
Local time: Wed 2023-03-08 13:18:29 CST
Universal time: Wed 2023-03-08 19:18:29 UTC
RTC time: Wed 2023-03-08 19:18:31
Time zone: America/Mexico_City (CST, -0600)
System clock synchronized: no
NTP service: active
RTC in local TZ: no
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment