Advertisement
Guest User

Untitled

a guest
May 22nd, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. import os
  2. if not os.environ.has_key("TZ"):
  3. # set it to something...
  4. os.environ["TZ"] = "EST+5EDT;100/2,300/2"
  5.  
  6. # importing this module will parse the TZ variable
  7. import tzparse
  8.  
  9. print "tzparams", "=>", tzparse.tzparams
  10. print "timezone", "=>", tzparse.timezone
  11. print "altzone", "=>", tzparse.altzone
  12. print "daylight", "=>", tzparse.daylight
  13. print "tzname", "=>", tzparse.tzname
  14.  
  15. ## tzparams => ('EST', 5, 'EDT', 100, 2, 300, 2)
  16. ## timezone => 18000
  17. ## altzone => 14400
  18. ## daylight => 1
  19. ## tzname => ('EST', 'EDT')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement