This question is really quite simple, and it's basically the title. I am in Western Australia.
Yup the pytz and datetime module is the way to go:
import pytz
from datetime import datetime
timezone = 'Australia/Perth'
py_timezone = pytz.timezone(timezone)
current_datetime = datetime.now(py_timezone)
If you need to find a specific timezone you use the all_timezones
property in pytz, which will return a list of all timezones.
import pytz
all_timezones = pytz.all_timezones
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With