Re: I look for a list to convert time zone abbreviation to full time zone in python

2013-12-03 Thread Stéphane Klein
Le 03/12/13 16:27, Stéphane Klein a écrit : > python-dateutil have a auto discover parse function, but I don't want to use > this auto discover feature For now, I use this : import dateutil.parser import pytz tz_str = '''-12 Y -11 X NUT SST -10 W CKT HAST HST TAHT TKT -9 V AKST GAMT GIT

Re: I look for a list to convert time zone abbreviation to full time zone in python

2013-12-03 Thread Stéphane Klein
Le 03/12/13 11:07, Stuart Bishop a écrit : > It could go into pytz (but generated from the IANA database, not from > the list you quote). Whether it should go into pytz is debatable. > Ok. > If you need to map an abbreviation back to a single timezone you are > solving the wrong problem, because

Re: I look for a list to convert time zone abbreviation to full time zone in python

2013-12-03 Thread Stuart Bishop
On Mon, Dec 2, 2013 at 11:18 PM, Stéphane Klein wrote: > * are there the same list somewhere (I didn't found in pytz) ? Not that I know of. > * is it possible to append this list in pytz or in standard python date > module ? It could go into pytz (but generated from the IANA database, not fro

Re: I look for a list to convert time zone abbreviation to full time zone in python

2013-12-02 Thread Joel Goldstick
On Mon, Dec 2, 2013 at 11:18 AM, Stéphane Klein wrote: > Hi, > > I would like to convert time zone abbreviation to full time zone in Python. > > I've found this information : > > * > > http://stackoverflow.com/questions/1703546/parsing-date-time-string-with-tim

I look for a list to convert time zone abbreviation to full time zone in python

2013-12-02 Thread Stéphane Klein
Hi, I would like to convert time zone abbreviation to full time zone in Python. I've found this information : * http://stackoverflow.com/questions/1703546/parsing-date-time-string-with-timezone-abbreviated-name-in-python I'm currently writing dict with this informati

Re: convert time

2011-09-12 Thread nn
On Sep 11, 1:00 am, Steven D'Aprano wrote: > 守株待兔 wrote: > > how can i convert "Dec 11" into  2011-12? > > if my_str == "Dec 11": >     return 1999  # 2011 - 12 > > Does that help? > > But seriously... 2011-12 is not a proper date, so the simplest way is > probably something like this: > > def con

Re: convert time

2011-09-10 Thread Ben Finney
Steven D'Aprano writes: > But seriously... 2011-12 is not a proper date It's valid by ISO 8601. The standard allows any number of parts to be dropped, from least to most significant, in order to have a value with deliberately reduced precision. https://secure.wikimedia.org/wikipedia/en/wiki

Re: convert time

2011-09-10 Thread Steven D'Aprano
守株待兔 wrote: > how can i convert "Dec 11" into 2011-12? if my_str == "Dec 11": return 1999 # 2011 - 12 Does that help? But seriously... 2011-12 is not a proper date, so the simplest way is probably something like this: def convert(date_str): month, short_year = date_str.split()

Re: convert time

2011-09-10 Thread Chris Rebert
2011/9/10 守株待兔 <1248283...@qq.com>: > how can i convert "Dec 11" into  2011-12? Read the fine manuals for the `time` or `datetime` modules. http://docs.python.org/library/datetime.html >>> from datetime import datetime >>> datetime.strptime("Dec 11", "%b %y") datetime.datetime(2011, 12, 1, 0, 0)

convert time

2011-09-10 Thread 守株待兔
how can i convert "Dec 11" into 2011-12?-- http://mail.python.org/mailman/listinfo/python-list

Re: convert time to UTC seconds since epoch

2010-07-21 Thread Steve Allen
On Jul 20, 6:57 pm, Chris Rebert wrote: [regarding trust of POSIX vis a vis leap seconds] > I'm not saying they necessarily should, but they're standardized and > the `time` module is based on POSIX/Unix-ish assumptions; not > following POSIX would be inconsistent and problematic. > Breaking stand

Re: convert time to UTC seconds since epoch

2010-07-20 Thread Chris Rebert
On Tue, Jul 20, 2010 at 6:48 PM, Greg Hennessy wrote: > On 2010-07-21, Chris Rebert wrote: >> On Tue, Jul 20, 2010 at 6:31 PM, Greg Hennessy wrote: >>> Given the documentation talks about "double leap seconds" which don't >>> exist, why should this code be trusted? >> >> Because they exist(ed) i

Re: convert time to UTC seconds since epoch

2010-07-20 Thread Greg Hennessy
On 2010-07-21, Chris Rebert wrote: > On Tue, Jul 20, 2010 at 6:31 PM, Greg Hennessy wrote: >> Given the documentation talks about "double leap seconds" which don't >> exist, why should this code be trusted? > > Because they exist(ed) in POSIX. Why should POSIX time calculations involving leap se

Re: convert time to UTC seconds since epoch

2010-07-20 Thread Chris Rebert
On Tue, Jul 20, 2010 at 6:31 PM, Greg Hennessy wrote: > On 2010-07-20, Rami Chowdhury 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

Re: convert time to UTC seconds since epoch

2010-07-20 Thread Greg Hennessy
On 2010-07-20, Rami Chowdhury 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?

Re: convert time to UTC seconds since epoch

2010-07-20 Thread Ian Kelly
On Tue, Jul 20, 2010 at 4:51 PM, Alexander 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 '-MM-DD >>> mm:HH:SS ZONE' to seconds since epoch in UTC? ZONE may be

Re: convert time to UTC seconds since epoch

2010-07-20 Thread Alexander
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 '-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. >

Re: convert time to UTC seconds since epoch

2010-07-20 Thread Rami Chowdhury
On Jul 20, 2010, at 12:26 , Alexander wrote: > Hi, list > > How with python standard library to convert string like '-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 Pytho

convert time to UTC seconds since epoch

2010-07-20 Thread Alexander
Hi, list How with python standard library to convert string like '-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. -- http://mail.python.org/mailman/listinfo/python-list

Re: convert time string in UTC to time in local time

2007-03-10 Thread Paul Boddie
[EMAIL PROTECTED] wrote: > I'm guessing there is an easy way to do this but I keep going around > in circles in the documentation. > > I have a time stamp that looks like this (corresponding to UTC time): > > start_time = '2007-03-13T15:00:00Z' > > I want to convert it to my local time. > > start_t

convert time string in UTC to time in local time

2007-03-08 Thread davelist
I'm guessing there is an easy way to do this but I keep going around in circles in the documentation. I have a time stamp that looks like this (corresponding to UTC time): start_time = '2007-03-13T15:00:00Z' I want to convert it to my local time. start_time = time.mktime(time.strptime(start_t