Set windows 7 time zone with Python

633 views Asked by At

I have the Local Time Zone, for example: Europe/Zurich How can I set it in Windows 7 with Python ? I know it's possible with tzutil in CMD.

1

There are 1 answers

2
shad0w_wa1k3r On BEST ANSWER

You need to use Popen from the subprocess module. An example (Windows 7, opening a cmd prompt)

>>> from subprocess import Popen
>>> Popen("start", shell=True)
<subprocess.Popen object at 0x02C199F0>

So, accordingly, you can execute your timezone commands in the prompt, through Python. (I could have given the full code, but apparently, that behavior is not good on SO (since you did not attempt the problem yourself).