Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set the timezone from command line ?

How can I set the timezone in Windows from command line or from a batch file?

Do I need to use powershell or cscript?

like image 523
Eduard Florinescu Avatar asked May 20 '13 18:05

Eduard Florinescu


People also ask

How do I get timezone in terminal?

You can check this by running the command ls -l /etc/localtime from the terminal. In this example, you can see the time zone is set to Central Standard Time, or UTC-6. The more modern method uses the timedatectl command, which is also used on today's Linux systems to set the time zone.

What is the command to set time?

Use Windows utility or the BIOS to set the time. The set-time command sets the current system time. The hours are specified from 00 (12:00 AM) to 23 (11:00 PM). The current time can be displayed by pressing CTRL+M or Enter at the TCL prompt, or by entering the TCL command time.


1 Answers

The command line utility that helps you change the time zone in Windows 7 is tzutil.exe and is known as Windows Time Zone Utility. This is a great tool for all the people who prefer working from the command prompt.

Use the /s parameter to set the time zone:

tzutil /s "universal standard time" 

Use the /g parameter to get the time zone:

tzutil /g 

Use the /l parameter to list the valid time zones.

tzutil /l 

[source]

like image 172
Ionică Bizău Avatar answered Sep 30 '22 21:09

Ionică Bizău