views:

83

answers:

3

I have been scouring the google machine and have come up with nothing to answer this. When making calls to:

time.gmtime()  

This ends up returning a time, as the subject line says, 5 hours ahead of my system time. I cannot figure out what is going on. time.tzname() returns the proper timezone. Aside from setting python to a timezone 5 hours earlier than mine, is there any way to correct this error?

+5  A: 

Are you looking for time.localtime? As docs say time.gmtime returns time struct in UTC.

SilentGhost
+6  A: 

Have you tried moving to London? I think that will solve your problem. :)

Jack Leow
At least for a few months out of the year...
Greg Hewgill
+3  A: 

time.gmtime() returns Greenwich Mean Time. This is five hours ahead of Eastern Standard Time, for example; taking into account daylight savings time, it's five hours ahead of Central Standard Time.

Tim Pietzcker
Thanks, that got it. Yay for not reading documentation well enough......
James Christie