Create Custom or Disable DST(daylight-saving time) in Oracle Solaris 10

A few weeks ago, it is announced (by The Energy and Natural Resources Ministry of Iran) that DST will be permanent and GMT+3:30(IRST) will be used forever in the country. From 2023, Iran will not set their clocks forward for Daylight Saving Time (DST) but remain on standard time permanently.

Based on following manual, we are going to create a custom timezone file for Iran +3:30 and disable DST in Oracle Solaris 10:

For the full list of the world timezone, please look in: /usr/share/lib/zoneinfo/

### Create custom TZ file
[root @ soltest]~ # vi custom_timeZone_IR
###Add following lines for Disable DST in Iran.

#Zone NAME           GMTOFF RULES/SAVE  FORMAT [UNTIL]
Zone  Iran-noDST   3:30   -           IRST   2022 Mar 22 00:00
                   3:30   -           IRST

### Creates the time conversion information file				   
[root @ soltest]~ # zic -d . custom_timeZone

[root @ soltest]~ # ls
Iran-noDST       custom_timeZone

### Copy new tz file to zoneinfo location
[root @ soltest]~ # cp Iran-noDST /usr/share/lib/zoneinfo

### Set required owner
[root @ soltest]~ # chown root:bin /usr/share/lib/zoneinfo/Iran-noDST

### Notifies active (running) processes to re-read timezone information
[root @ soltest]~ # tzreload


### Check the current time for generated time zone
[root @ soltest]~ # zdump -v Iran-noDST
Iran-noDST  Tue Mar 22 17:16:31 2022 UTC = Tue Mar 22 20:46:31 2022 IRST isdst=0
Iran-noDST  Fri Dec 13 20:45:52 1901 UTC = Sat Dec 14 00:15:52 1901 IRST isdst=0
Iran-noDST  Sat Dec 14 20:45:52 1901 UTC = Sun Dec 15 00:15:52 1901 IRST isdst=0
Iran-noDST  Tue Jan 19 03:14:07 2038 UTC = Tue Jan 19 06:44:07 2038 IRST isdst=0
Iran-noDST  Mon Jan 18 03:14:07 2038 UTC = Mon Jan 18 06:44:07 2038 IRST isdst=0



### Edit timezone file and disable DST
[root @ soltest]~ # vi /etc/TIMEZONE
##Add/Update following line

TZ=Iran-noDST

### Edit system default parameters and disable DST
[root @ soltest]~ # vi /etc/default/init
##Add/Update following line

TZ=Iran-noDST

### Set timezone variable(Non global)
[root @ soltest]~ # TZ="Iran-noDST"

### Check current environment variables
[root @ soltest]~ # env
HZ=
TERM=xterm
SHELL=/sbin/bash
PATH=/usr/sbin:/usr/bin:/etc:/usr/local/bin
MAIL=/var/mail/root
PWD=/root
EDITOR=vi
TZ=Iran-noDST
PS1=[\u @ \h]\w #
HOME=/root
SHLVL=2
LOGNAME=root
HISTTIMEFORMAT=%F %T
_=/usr/bin/env


### Check System time and date
[root @ soltest]~ # date
Tue Mar 15 12:57:43 IRST 2022

Leave a Comment