Prev: Compile python executable only for package deployment on Linux
Next: linux console command line history
From: Alexander on 20 Jul 2010 15:26 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.
From: Rami Chowdhury on 20 Jul 2010 16:46 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 ? HTH, Rami ------------- Rami Chowdhury "Never assume malice when stupidity will suffice." -- Hanlon's Razor 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD)
From: Alexander on 20 Jul 2010 18:51 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.
From: Greg Hennessy on 20 Jul 2010 21:31 On 2010-07-20, Rami Chowdhury <rami.chowdhury(a)gmail.com> wrote: > If you have a sufficiently recent version of Python, have you >considered time.strptime: >http://docs.python.org/library/time.html#time.strptime ? Given the documentation talks about "double leap seconds" which don't exist, why should this code be trusted?
From: Chris Rebert on 20 Jul 2010 21:44 On Tue, Jul 20, 2010 at 6:31 PM, Greg Hennessy <greg.hennessy(a)cox.net> wrote: > On 2010-07-20, Rami Chowdhury <rami.chowdhury(a)gmail.com> wrote: >> If you have a sufficiently recent version of Python, have you >>considered time.strptime: >>http://docs.python.org/library/time.html#time.strptime ? > > Given the documentation talks about "double leap seconds" which don't > exist, why should this code be trusted? Because they exist(ed) in POSIX. See http://www.ucolick.org/~sla/leapsecs/onlinebib.html : """ The standards committees decided that POSIX time should be UTC, but the early POSIX standards inexplicably incorporated a concept which never existed in UTC -- the ``double leap second''. This mistake reportedly existed in the POSIX standard from 1989, and it persisted in POSIX until at least 1997. """ Cheers, Chris -- http://blog.rebertia.com
|
Next
|
Last
Pages: 1 2 Prev: Compile python executable only for package deployment on Linux Next: linux console command line history |