-2

Currently I am setting time zone GMT+5 on my Linux CentOS 7 machine by linking /etc/localtime to /usr/share/zoneinfo/Etc/GMT-5.

I want to create a zone info file for example /usr/share/zoneinfo/Etc/GMT-5:30 that enables me to set the current timezone to GMT+5:30 without having to worry about DST changes.

I am aware that I could link /etc/localtime to /usr/share/zoneinfo/Asia/Kolkata for example but then I will have to worry about DST changes even if it may not be implemented in the mean time.

Also I am aware of TZ=GMT+5:30; export $TZ but I am worried that this approach backfire for some reason in the future.

Muhammad Charaf
  • 343
  • 3
  • 16
  • What do you mean "to worry about DST changes"? DST doesn't apply in `Asia/Kolkata` presently. Do you mean "if it ever does in the future, I don't want to observe it?" If so - why ever would you want to make such a supposition? – Matt Johnson-Pint Feb 03 '19 at 17:56

1 Answers1

0

If you don't want to use $TZ variable, you may want to create your own timezone file.

You need create a text file (say MyZone.zic) with

Zone MyZone 5:30 - GMT-5:30

then run

zic -d <desired_folder> MyZone.zic

then link compiled file to /etc/localtime

Hedgehog
  • 479
  • 6
  • 16