Advertisement
treyhunner

Timezone Difference

Nov 5th, 2016
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. >>> import pytz
  2. >>> import datetime
  3. >>> chicago_timezone = pytz.timezone('America/Chicago')
  4. >>> str(chicago_time.utcoffset(datetime.datetime.now()))
  5. '-1 day, 19:00:00'
  6. >>> str(chicago_time.utcoffset(datetime.datetime.now() + datetime.timedelta(days=1)))
  7. '-1 day, 18:00:00'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement