3

I have ntp server with OS Ubuntu 20.04

we will have new day light saving time change in Egypt on 27th of April 2023

I tried to check the dst status using "timedatectl" command but unfortunately it's not showing dst configuration status in the command output.

I have configured timezone to be "africa/cairo" Moreover, in the ntp.conf file I configured the reference link to be "http://africa.pool.ntp.org/join.html" server 0.africa.pool.ntp.org server 1.africa.pool.ntp.org server 2.africa.pool.ntp.org server 3.africa.pool.ntp.org

I need support in the following:

  • How to check DST status in ubuntu as it's not shown in "datetimectl" command output.
  • Is it updated in ubuntu 20.04 to change time automatically for cairo timezone on 27th of April.
  • Is NTP ubuntu server will change time automatically or I have to do a manual action.

Thank you

  • First of all NTP has nothing to do with time zones. To check the DST dates throughout the years, I had written a Perl script https://kadifeli.com/fedon/hint.php?perl_dst You can test your time zone using that script. – FedKad Apr 11 '23 at 11:41
  • From your question. Is it updated in ubuntu 20.04 to change time automatically for cairo timezone on 27th of April. That is a question for the developers none of which are volunteers here. – David Apr 11 '23 at 11:51
  • This reads like a duplicate of https://askubuntu.com/questions/1459637/mexico-ntp-no-more-time-changes-since-2023-and-my-ntp-server/1459642#1459642 - one's Mexico vs. Egypt but the point is still the same iwth regards to NTP. – Thomas Ward Apr 11 '23 at 14:56
  • @AhmedElshamy Please, see my updated answer. – FedKad Apr 13 '23 at 10:33

3 Answers3

3

First of all, NTP has nothing to do with time zones. All time calculation on NTP is done in UTC. So, selecting a pool from Africa will not change anything, except the NTP servers that your system uses. All NTP servers return the "universal time" and not any kind of "local time."

You should never update your system's clock manually, unless you have no other way to synchronize the clock automatically. Besides this, changing manually the clock because of DST or time zone changes, is absolutely WRONG!

Time zone databases are regularly updated and Ubuntu will update itself, as long as you keep your system(s) in supported versions and updated through the apt command (or automatically).

By using the following commands on my fully updated (22.10) system:

$ timedatectl list-timezones | grep -i -e egypt -e cairo
Africa/Cairo
Egypt

$ zdump -v Egypt Egypt -9223372036854775808 = NULL Egypt -9223372036854689408 = NULL Egypt Sun Sep 30 21:54:50 1900 UT = Sun Sep 30 23:59:59 1900 LMT isdst=0 gmtoff=7509 [...] Egypt Thu Jul 31 21:59:59 2014 UT = Thu Jul 31 23:59:59 2014 EET isdst=0 gmtoff=7200 Egypt Thu Jul 31 22:00:00 2014 UT = Fri Aug 1 01:00:00 2014 EEST isdst=1 gmtoff=10800 Egypt Thu Sep 25 20:59:59 2014 UT = Thu Sep 25 23:59:59 2014 EEST isdst=1 gmtoff=10800 Egypt Thu Sep 25 21:00:00 2014 UT = Thu Sep 25 23:00:00 2014 EET isdst=0 gmtoff=7200 Egypt 9223372036854689407 = NULL Egypt 9223372036854775807 = NULL

$ diff <(zdump -v Africa/Cairo | cut -d' ' -f2- ) <(zdump -v Egypt | cut -d' ' -f2- )

I noticed that the last DST change in Egypt (or Africa/Cairo) time zone occurred in the year 2014 and there are no provisioned DST changes for Egypt in the current version of time zone information database on my system.

The last command shows that Africa/Cairo and Egypt are actually the same time zone.

As an alternative; I had written a Perl script that will check the DST dates throughout the past and future years. You can test your current or selected time zone using that script also on your system, just to be sure:

$ TZ=Egypt ./dstcheck.pl
 Testing seconds from 733276801 to 2200000000...
1993/03/28 Sun 02:00:01 [1993/03/28 Sun 00:00:01 UTC] +2 - Seconds: 733276801
1993/05/01 Sat 02:00:01 [1993/04/30 Fri 23:00:01 UTC] +3 - Seconds: 736210801
1993/10/01 Fri 02:00:01 [1993/10/01 Fri 00:00:01 UTC] +2 - Seconds: 749433601
[...]
2014/06/26 Thu 23:00:01 [2014/06/26 Thu 21:00:01 UTC] +2 - Seconds: 1403816401
2014/08/01 Fri 01:00:01 [2014/07/31 Thu 22:00:01 UTC] +3 - Seconds: 1406844001
2014/09/25 Thu 23:00:01 [2014/09/25 Thu 21:00:01 UTC] +2 - Seconds: 1411678801

If you are unfortunate to live in a country where the government makes the "stupidity" (sorry for the term!) to decide for a DST change in such short notice , you may try to update the time zone files yourself (not an easy task) or wait and hope that they will get updated before April 27.


Note: For current time zone information, please go to IANA Time Zone Database page. It seems that the recent Egypt DST change was incorporated into the latest version 2023c (released on 2023-03-28), so you may hope that Ubuntu will get updated too very "soon"!


Update (2023-04-13)

As of today, it seems that the updated version (2023c) of package tzdata is available; you can apt upgrade or apt dist-upgrade your system and retry the tests I mentioned above:

$ zdump -v Egypt | grep 2023
Egypt  Thu Apr 27 21:59:59 2023 UT = Thu Apr 27 23:59:59 2023 EET isdst=0 gmtoff=7200
Egypt  Thu Apr 27 22:00:00 2023 UT = Fri Apr 28 01:00:00 2023 EEST isdst=1 gmtoff=10800
Egypt  Thu Oct 26 20:59:59 2023 UT = Thu Oct 26 23:59:59 2023 EEST isdst=1 gmtoff=10800
Egypt  Thu Oct 26 21:00:00 2023 UT = Thu Oct 26 23:00:00 2023 EET isdst=0 gmtoff=7200

$ TZ=Egypt dstcheck.pl | grep 2023/ 2023/04/28 Fri 01:00:01 [2023/04/27 Thu 22:00:01 UTC] +3 - Seconds: 1682632801 2023/10/26 Thu 23:00:01 [2023/10/26 Thu 21:00:01 UTC] +2 - Seconds: 1698354001

If this package seems to be "kept back" currently, you can wait a few days or just do apt install tzdata.

FedKad
  • 10,515
  • Great answer! Thanks for pointing out the flow from the IANA database to the tzdata package to the Ubuntu users. And especially thanks for showing how to check the tzdata data. – user535733 Apr 15 '23 at 22:58
0

For all those not able to upgrade tzdata, there's an easy way to update this data by updating the IANA DB

wget https://data.iana.org/time-zones/releases/tzdata2023c.tar.gz
tar xvzf tzdata2023c.tar.gz
sudo zic africa
sudo zic antarctica
sudo zic asia
sudo zic australasia
sudo zic europe
sudo zic northamerica
sudo zic southamerica
juan-vg
  • 11
-3

First of all let me clarify what you said (If your country has made the "stupidity" (sorry for the term!) to decide for a DST change in such short notice) is not acceptable for any reason or any county, it is rude . I think he asked question and as you wanted to reply you can reply on his question in technical perspective.

And in hus question he just mentioned that clock will be changed on 27th of april but this decision announced long time ago

  • 1
    The same "stupidity" was made by my government too (several times in the past). Btw, you are right: countries are not stupid, governments are. I will correct my answer in this respect. However it is still stupid to make such changes and allow less than a few years of transition period for all devices to get updated. What will happen to smart phones, IOT devices, mainframes etc. that are updated much less frequently? A chaos should be expected in April 27. – FedKad Apr 16 '23 at 05:39