document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. import pytz, dateutil.parser
  2. # Z is for timezone
  3. gmtTime = dateutil.parser.parse("2011-07-14T6:00:00.000Z")
  4.  
  5. # To convert naive time to tz-aware time
  6. now-aware = pytz.UTC.localize(naive-time)
  7.  
  8. # To convert UTC time to localtime
  9. # weird huh? shouldnt it be Asia/Hanoi
  10. localtime = utcTime.astimezone(pytz.timezone("Asia/Ho_Chi_Minh"))
  11.  
  12.  
  13. # Create a datetime variable with timezone
  14. start = datetime(1970, 1, 1, tzinfo=pytz.UTC)
');