Learn to Code via Tutorials on Repl.it!

← Back to all posts
Find current time in your region using Python.
OldWizard209

So first import datetime:
from datetime import datetime

Then import pytz and import timezone:
from pytz import timezone

Then you can do this:

So I have set the timezone to US/Eastern. There are specific codes for timezones. You can find them here

or if you want import it yourself:

Hope this helps y'all

Voters
11irishjs
GenSci001
OldWizard209
Comments
hotnewtop
[deleted]

Good job :)