1. Learn
  2. /
  3. Courses
  4. /
  5. Working with Dates and Times in Python

Connected

Exercise

Creating timezone aware datetimes

In this exercise, you will practice setting timezones manually.

Instructions 1/3

undefined XP
  • 1
    • Import timezone.
    • Set the tzinfo to UTC, without using timedelta.
  • 2
    • Set pst to be a timezone set for UTC-8.
    • Set dt's timezone to be pst.
  • 3
    • Set aedt to be a timezone set for UTC+11.
    • Set dt's timezone to be aedt.