Skip to content

Instantly share code, notes, and snippets.

@jharmn
Created September 10, 2013 22:15
Show Gist options
  • Select an option

  • Save jharmn/6516536 to your computer and use it in GitHub Desktop.

Select an option

Save jharmn/6516536 to your computer and use it in GitHub Desktop.
A python-based example of timezone resolution
import datetime
from pytz import timezone
from dateutil.parser import parse
appt = parse("2013-08-16T15:30:15Z") #From UTC/Zulu time
tzinfo = timezone("America/Chicago") #Retrieve timezone info for US Central
apptLocal = appt.astimezone(tzinfo) # Date is modulated as 2013-08-16 10:30:15-05:00
print apptLocal
# Produces 2013-08-16 10:30:15-05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment