建立具時區意識的 datetime
在這個練習中,你會練習手動設定時區。
本練習屬於課程
在 Python 處理日期與時間
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Import datetime, timezone
from datetime import datetime, ____
# October 1, 2017 at 15:26:26, UTC
dt = datetime(2017, 10, 1, 15, 26, 26, tzinfo=____)
# Print results
print(dt.isoformat())