자전거는 몇 시에 출발했을까요? (Global edition)
한 타임존의 datetime을 다른 타임존으로 옮길 때는 .astimezone()과 tz를 사용하세요. 보통은 UTC로 변환하지만, 여기서는 재미 삼아 'America/New_York'에서 몇 가지 다른 타임존으로 바꿔 보겠습니다.
이 연습은 강의의 일부입니다
Python에서 날짜와 시간 다루기
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# 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())