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
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
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
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
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
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
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
守株待兔 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()
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)
how can i convert "Dec 11" into 2011-12?--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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?
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
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.
>
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
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
[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
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
21 matches
Mail list logo