Question

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.

Était-ce utile?

La solution

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).

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top