2

I want to be able to set timezone for Ubuntu hosts, from command line (given in POSIX format). I was searching for options, and found timedatectl from systemd package but since I did not want the entire systemd, but just timedatectl, I downloaded the .deb package and extracted the timedatectl binary, but that expects GLIBC>=2.17, I have GLIBC 2.15 on my Ubuntu 12.04 !

Is there any other utility, which is simple enough to use, that I can install, to set timezone in POSIX format (e.g. EST+10)

Ani
  • 59

1 Answers1

6

That would not work:

$ sudo timedatectl set-timezone EST+10
Failed to set time zone: Invalid time zone 'EST+10'

You'd have to use:

$ sudo timedatectl set-timezone EST

In Ubuntu 12.04 you can use this command:

sudo ln -sf /usr/share/zoneinfo/EST /etc/localtime

To get EST from EST+10:

grep -Po "^[A-Z]{3,3}"

EST+10

EST is GMT-5, EST+10 is GMT+5

Therefore you can use:

sudo ln -sf /usr/share/zoneinfo/Etc/GMT+5 /etc/localtime
A.B.
  • 92,275