Re: from date/time string to seconds since epoch

2005-07-06 Thread Peter Kleiweg
[EMAIL PROTECTED] schreef op de 6e dag van de hooimaand van het jaar 2005: > You can calculate the offset of where you are like this: > > [EMAIL PROTECTED]:~ $ python > Python 2.4.1 (#2, Mar 30 2005, 21:51:10) > [GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2 > Type "help", "copyright", "credits"

Re: from date/time string to seconds since epoch

2005-07-06 Thread [EMAIL PROTECTED]
You can calculate the offset of where you are like this: [EMAIL PROTECTED]:~ $ python Python 2.4.1 (#2, Mar 30 2005, 21:51:10) [GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. py> import time py> offset = 0 py> if time.daylight:

from date/time string to seconds since epoch

2005-07-06 Thread Peter Kleiweg
Is there a safe and clean way to parse a date/time string into seconds since epoch? I have a string with date and time in GMT. I can get the correct value using this: #!/usr/bin/env python import os os.environ['TZ'] = 'UTC' import time s = 'Wed, 06 Jul 2005 16:49:38 GMT' seconds = time.mktime(t