If you are using a Ubuntu VPS or dedicated server, then you may have noticed emails coming from server doesn’t match your local timezone.
Below are 2 methods to quickly fix this issue…
Method#1 – Interactive Mode
Just run following command…
dpkg-reconfigure tzdata
and it will show a list of timezone from where you can select your timezone
Method#2 – Non-Interactive mode
In this method you need to provide value of timezone manually.You can find timezone values here.
sudo echo "Asia/Kolkata" > /etc/timezone sudo dpkg-reconfigure --frontend noninteractive tzdata
After running above command I got following output:
Current default time zone: 'Asia/Kolkata' Local time is now: Thu Jul 12 18:56:32 IST 2012. Universal Time is now: Thu Jul 12 13:26:32 UTC 2012.
Why 2 methods?
Non-interactive way comes handy if you want to change timezone programatically. 😉