On Tue, Jul 20, 2010 at 4:51 PM, Alexander <b3n...@yandex.ru> wrote: > On 21.07.2010 00:46, Rami Chowdhury wrote: >> On Jul 20, 2010, at 12:26 , Alexander wrote: >> >>> Hi, list >>> >>> How with python standard library to convert string like 'YYYY-MM-DD >>> mm:HH:SS ZONE' to seconds since epoch in UTC? ZONE may be literal time >>> zone or given in explicit way like +0100. >> If you have a sufficiently recent version of Python, have you considered >> time.strptime: http://docs.python.org/library/time.html#time.strptime ? >> > Yes. May be I don't undertand something. but it seems strptime doesn't > work with timezones at all. Only understands localzone and dates w/o zones.
Have you looked at the dateutil.parser module? It's not part of the standard library but probably does what you need. http://labix.org/python-dateutil#head-c0e81a473b647dfa787dc11e8c69557ec2c3ecd2 Cheers, Ian -- http://mail.python.org/mailman/listinfo/python-list