1. 学习
  2. /
  3. 课程
  4. /
  5. Working with Dates and Times in Python

Connected

练习

Creating timezone aware datetimes

In this exercise, you will practice setting timezones manually.

说明 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.