4

I was wondering how to Enable Dst in centos7 timedatectl?

Currently I get:

[root@HP-Test ~]# timedatectl
  Local time: Fri 2017-09-22 00:07:01 +0330
Universal time: Thu 2017-09-21 20:37:01 UTC
    RTC time: Thu 2017-09-21 20:37:01
   Time zone: Asia/Tehran (+0330, +0330)
 NTP enabled: yes
NTP synchronized: no
RTC in local TZ: no
  DST active: no
 Last DST change: DST ended at
              Thu 2017-09-21 23:59:59 +0430
              Thu 2017-09-21 23:00:00 +0330
 Next DST change: DST begins (the clock jumps one hour forward) at
              Wed 2018-03-21 23:59:59 +0330
              Thu 2018-03-22 01:00:00 +0430

I want to enable the DST so it will jump the time back or forward.

senaps
  • 143

3 Answers3

2
[root@test ~]# timedatectl set-timezone EST5EDT
2

If your timezone database is up to date, then the DST specification is included in the '/' style timezone definition.

In your timedatectl output, the DST active: no means "DST is not in effect right now". After Wed 2018-03-21 23:59:59 +0330 the clock will jump one hour forward and the DST active: field will change to yes.

In short, it looks like DST is enabled in your timezone.

telcoM
  • 4,598
  • 2
    What if timedatectl does not output any DST information at all? When I run timedatectl I do not get a "DST Active" line, or any other mention of DST – Fopedush Jul 11 '18 at 18:15
  • 1
    Maybe it means your timezone does not use the concept of DST at all then? – telcoM Jul 11 '18 at 20:33
1

DST is a result of your point in time and since your clock is on 2017-09-22 it means it switched DST off until 2018-03-22 for your time zone. There is no way to change that except changing your system time.

If you want to do this for application testing then you may want to have a closer look at your testing framework as some off function overloading to influence date/time for testing purposes.

hspaans
  • 251