Graham Ashton
2002-04-18 09:14:03 UTC
I have not been following, so pardon me if this has already been
suggested, but on a platform where you have 2.0 or later and strptime,
lt = time.mktime(time.strptime(sys.argv[1], '%d %b %Y'))
utoffset = time.mktime(time.gmtime(lt)) - lt
print lt - utoffset
Thanks for that.suggested, but on a platform where you have 2.0 or later and strptime,
lt = time.mktime(time.strptime(sys.argv[1], '%d %b %Y'))
utoffset = time.mktime(time.gmtime(lt)) - lt
print lt - utoffset
I was using strptime() and mktime() to get seconds since the epoch in
localtime. I was trying to work out if I could do anything simpler than
... if time.daylight:
... return secs - time.timezone - time.altzone
... else:
... return secs - time.timezone
to get the seconds since the epoch into UTC. It's looking as though the
answer (in general) is "no".
--
Graham Ashton
Graham Ashton