Instead you should be using a fully named time zone like America/New_York or Europe/London or whatever is appropriate for your location. Another way to check the time zone is to view the path the symlink points to using the ls command: ls -l /etc/localtime lrwxrwxrwx 1 root root 27 Dec 3 16:29 /etc/localtime -> /usr/share/zoneinfo/Etc/UTC Changing the Time Zone in Linux Before changing the time zone, you’ll need to find out the long name of the time zone you want to use. You should almost never need to use these zones. I find this definition quite confusing and always try to avoid these zone identifiers completely. We need sudo privileges to change this file because this is a system-wide configuration. Next Scheduled DST Transition There are no future Daylight Saving Time rules for this time zone. Most Recent DST Transition The Etc/UTC time zone has never observed Daylight Saving Time. Then we register (store) the copy module's results in a variable called timezone for later use. Current Date and Time in Etc/UTC Fri 06:28 A.M.
Zones like Etc/GMT+6 are intentionally reversed for backwards compatibility with POSIX standards. Parapluie Note that Etc/.-zones are fixed offsets where the sign is opposite to what is standard. As you can see, we're just adding one line: Etc/UTC plus a return (newline character) which gets placed in the file /etc/timezone. It is successor to Greenwich Mean Time (GMT). NOTE: There's also this option in Ubuntu 14.04 and higher with a single command (source: Ask Ubuntu - setting timezone from terminal): $ sudo timedatectl set-timezone Etc/GMT-6 Coordinated Universal Time (UTC) is the world time standard that regulates clocks and time. Local time is now: Thu Jan 23 11:52:16 GMT-6 2014. To avoid timezone confusion and the complexities of adjusting clocks for daylight saving time in accordance with regional custom. To change the timezone on either of these distros you can use this command: $ sudo dpkg-reconfigure tzdata
Now date shows the different timezone: $ date -u The Etc/UTC time zone has never observed Daylight Saving Time. $ sudo ln -s /usr/share/zoneinfo/Etc/GMT+6 /etc/localtime I would recommend linking to it rather than copying however. $ ls /usr/share/zoneinfo/Īfrica/ CET Etc/ Hongkong Kwajalein Pacific/ ROK zone.tabĪmerica/ Chile/ Europe/ HST Libya Poland Singapore ZuluĪntarctica/ CST6CDT GB Iceland MET Portugal TurkeyĪrctic/ Cuba GB-Eire Indian/ Mexico/ posix/ UCTĪsia/ EET GMT Iran MST posixrules UniversalĪtlantic/ Egypt GMT0 iso3166.tab MST7MDT PRC US/Īustralia/ Eire GMT-0 Israel Navajo PST8PDT UTCĬanada/ EST5EDT Greenwich Japan NZ-CHAT ROC W-SU Available Time Zones -11:00, Pacific/Niue -11:00, Pacific/PagoPago, Pacific/Samoa, US/Samoa -10:00, America/Adak, America/Atka, US/Aleutian -10:00, Etc/GMT. NOTE: If you're looking for a distro-agnostic solution, this also works on Debian, though there are simpler approaches below if you only need to be concerned with Debian machines.
If you're using a distribution such as Red Hat then your approach of copying the file would be mostly acceptable. Take a look at this blog post titled: How To: 2 Methods To Change TimeZone in Linux.