Welcome! Log In Create A New Profile

Advanced

Setting timezone

Posted by haridsv 
Setting timezone
September 03, 2017 07:09AM
For setting timezone from CLI (unattended), I found that you need to update /etc/timezone and dpkg-reconfigure tzdata, something like this (from here:

$ echo "Australia/Adelaide" | sudo tee /etc/timezone
Australia/Adelaide 
$ sudo dpkg-reconfigure --frontend noninteractive tzdata

Current default time zone: 'Australia/Adelaide'
Local time is now:      Sat May  8 21:19:24 CST 2010.
Universal Time is now:  Sat May  8 11:49:24 UTC 2010.

When I do the same, it doesn't work:

 
admin@pogoplug:~$ echo Asia/Calcutta | sudo tee /etc/timezone
Asia/Calcutta
admin@pogoplug:~$ cat /etc/timezone
Asia/Calcutta
admin@pogoplug:~$ sudo dpkg-reconfigure -f noninteractive tzdata

Current default time zone: 'SystemV/PST8PDT'
Local time is now:      Sun Sep  3 05:08:23 PDT 2017.
Universal Time is now:  Sun Sep  3 12:08:23 UTC 2017.

admin@pogoplug:~$ cat /etc/timezone
SystemV/PST8PDT

The timezone simply gets reset. Anyone know how to get this working?
Re: Setting timezone
September 03, 2017 03:17PM
haridsv,

Did you set locale?

IIRC, I think you need set timezone as root.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 09/03/2017 03:20PM by bodhi.
Re: Setting timezone
September 03, 2017 09:25PM
bodhi Wrote:
-------------------------------------------------------
> haridsv,
>
> Did you set locale?
>
> IIRC, I think you need set timezone as root.

I didn't set locale, will look into it. I did use sudo where required.
Re: Setting timezone
September 05, 2017 12:50AM
Here is the additional step I needed to do before reconfiguring tzdata:
# ln -sf /usr/share/zoneinfo/Asia/Calcutta /etc/localtime
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: