Python Text

Let’s now see how to set a date to a specific timezone

Explanation:

We’re using a different Python library called pytz to deal with different timezones, for ex we can convert the default time that was showing up in EST to Hawaii time by specifying the timezone when we use datetime.now(), and we can also set it to London’s, Tokyo’s, etc for all available timezones. Note one nuance is that your specific city may not be available in the timezones specified, for ex specifying Sacramento for a West Coast time may actually require you to specify Los_Angeles instead.