Debian – Configure localtime. dpkg-reconfigure tzdata

debianscriptingtimezone

I'm using this to configure localtime:

dpkg-reconfigure tzdata 

It is ncurses interface. I'm looking for the way to programming this. Is there true way without user ncurses interface?

How to change localtime by one shell command?

Best Answer

I'm assuming you want to change the timezone by one shell command.

Do you have timedatectl on your system?

If so:

timedatectl status will show your current settings.

timedatectl list-timezones shows available timezones.

timedatectl set-timezone Antarctica/Mawson sets it.

Note: If the RTC is configured to be in the local time, this will also update the RTC time.

Related Question