import datetime
pacific = datetime.timezone(datetime.timedelta(hours=-8))
eastern = datetime.timezone(datetime.timedelta(hours=-5))
naive = datetime.datetime(2014, 4, 21, 9)
aware = datetime.datetime(2014, 4, 21, 9, tzinfo=pacific)
# now, let's change the timezone.. ( what's that mean? a ha ! travel to the another world synchronously )
# Tool : astimezone
# Q : as + timezone/.. "as" ?
aware.astimezone(eastern)
# later pytz library ( hours=-8, hours=-5 is headache. )
댓글 없음:
댓글 쓰기