Ask coding questions

← Back to all posts
How set up to my time zone ?
FineMouche

i tried something L10 but it didn't worked

edit : i fix my issue with :
import os

os.environ['TZ'] = 'Europe/Paris'
time.tzset()

Voters
FineMouche
Comments
hotnewtop
CodingElf66

Very well! I'll show you how to do it!

Here, you can choose your timezone, then it would return the time in your timezone!

Hope this helps, hope you can mark it as answered!

FineMouche

@CodingElf66 what you mean by "now you can choose it ?" what write and where ? (for France timezone)

and as you can see i find a way to do it, it work, but i don't know if it's the easiest way :

import os

os.environ['TZ'] = 'Europe/Paris'
time.tzset()

CodingElf66

@FineMouche Yes I think it's like that!