BaşlayınÜcretsiz Başlayın

What time did the bike leave? (Global edition)

When you need to move a datetime from one timezone into another, use .astimezone() and tz. Often you will be moving things into UTC, but for fun let's try moving things from 'America/New_York' into a few different time zones.

Bu egzersiz

Working with Dates and Times in Python

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Create the timezone object
uk = ____

# Pull out the start of the first trip
local = onebike_datetimes[0]['start']

# What time was it in the UK?
notlocal = local.____(____)

# Print them out and see the difference
print(local.isoformat())
print(notlocal.isoformat())
Kodu Düzenle ve Çalıştır