MulaiMulai sekarang secara gratis

Creating timezone aware datetimes

In this exercise, you will practice setting timezones manually.

Latihan ini adalah bagian dari kursus

Working with Dates and Times in Python

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# 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())
Edit dan Jalankan Kode