[3:]
return s
But this does not seem to be the right way to do it. Could we have
datetime.xsdformat()? Or maybe extra format characters in strftime that
represent the hour and the minute part of the time zone offset? Or maybe
I'm not aware of some method in the standard library that conve
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
indows, and
> that would be a proper tracker issue.
Can you elaborate on how this would help my case?
> > (Now change time zone to UTC, for example. Now clock reads 6:41pm.)
> >> import datetime
>
> Without a restart, this is a no=op.
Whoops, thanks; I just copied and
tever time zone your computer is set to when you
start the application, that's what datetime will use--the time zone will
*not* be updated in the application when you update it manually with
Windows. So, if you change the time zone (say, after traveling with
your laptop), all datetimes will
On Apr 3, 7:37 am, Steven D'Aprano wrote:
> On Tue, 02 Apr 2013 17:04:12 -0700, CM wrote:
> > To summarize the issue: In an application, I have been using Python's
> > datetime module to get the current time. But it seems that, at least
> > with Windows (XP), what
> 2013-04-03 14:41:13.124000 < WRONG
> ^
(That carrot is supposed to be pointing to the 4 in 14, which should
be 18.)
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 02 Apr 2013 17:04:12 -0700, CM wrote:
> To summarize the issue: In an application, I have been using Python's
> datetime module to get the current time. But it seems that, at least
> with Windows (XP), whatever time zone your computer is set to when you
> start the ap
e. But it seems that, at least
with Windows (XP), whatever time zone your computer is set to when you
start the application, that's what datetime will use--the time zone
will *not* be updated in the application when you update it manually
with Windows. So, if you change the time zone (say, after
Getting the local time zone in Python is rather difficult.
As of 2008, two articles indicate that the current mechanisms
totally suck:
"Python and time zones part 2: The beast returns!":
http://regebro.wordpress.com/2008/05/10/python-and-time-zones-part-2-the-beast-returns/
&quo
On Aug 25, 8:48 am, Lawrence D'Oliveiro wrote:
> In message
> <45faa241-620e-42c7-b524-949936f63...@f6g2000yqa.googlegroups.com>, Alex
>
> Willmer wrote:
> > Dateutil has it's own timezone database ...
>
> I hate code which doesn’t just use /usr/share/zoneinfo. How many places do
> you need to pat
In message
<45faa241-620e-42c7-b524-949936f63...@f6g2000yqa.googlegroups.com>, Alex
Willmer wrote:
> Dateutil has it's own timezone database ...
I hate code which doesn’t just use /usr/share/zoneinfo. How many places do
you need to patch every time somebody changes their daylight-saving rules?
On Aug 24, 4:16 pm, Alex Willmer wrote:
> On Aug 24, 9:45 pm, m_ahlenius wrote:
>
>
>
> > whereas this fails:
> > myStrA = 'Sun Aug 22 19:03:06 PDT'
> > gTimeA = strptime( myStrA, '%a %b %d %H:%M:%S %Z')
> > print "gTimeA = ",gTimeA
>
> > ValueError: time data 'Sun Aug 22 19:03:06 PDT' does not m
och time calculations.
>
> When I run the following code with the time zone string set to 'GMT'
> it works ok.
>
> This works:
>
> myStrA = 'Sun Aug 22 19:03:06 GMT'
>
> gTimeA = strptime( myStrA, '%a %b %d %H:%M:%S %Z')
>
> print "gTimeA
On Aug 24, 9:45 pm, m_ahlenius wrote:
>
> whereas this fails:
> myStrA = 'Sun Aug 22 19:03:06 PDT'
> gTimeA = strptime( myStrA, '%a %b %d %H:%M:%S %Z')
> print "gTimeA = ",gTimeA
>
> ValueError: time data 'Sun Aug 22 19:03:06 PDT' does not match format
> '%a %b %d %H:%M:%S %Z'
Support for the %Z
Hi,
perhaps I missed this posted already somewhere.
I am got a program which reads time stings from some devices which
are providing the time zones. I have to take this into account when
doing some epoch time calculations.
When I run the following code with the time zone string set to
th this query
>
> > > new_start_date = "NOW() - '29 days'::INTERVAL"
> > > self.dyndb.orderdb.query('''update set creation_date
> > > = %s
> > > where id_order = %s''', (new_start_date,
On Mar 31, 3:10 am, "D'Arcy J.M. Cain" wrote:
> On Tue, 30 Mar 2010 15:46:12 -0700 (PDT)
>
> ASh wrote:
> > > > new_start_date = "NOW() - '29 days'::INTERVAL"
> > > > self.dyndb.orderdb.query('''update set creation_date
> > > > = %s
> > > > where id_order
set creation_date
> > = %s
> >where id_order = %s''', (new_start_date, "123"))
> >
> >
> >
> > ...
> > psycopg2.DataError: invalid input syntax for type timestamp with time
> > zone: "NOW() - '29 days'::I
On Tue, 30 Mar 2010 15:46:12 -0700 (PDT)
ASh wrote:
> > > new_start_date = "NOW() - '29 days'::INTERVAL"
> > > self.dyndb.orderdb.query('''update set creation_date
> > > = %s
> > > where id_order = %s''', (new_start_date, "123"))
> >
> > Put single quotes a
D'Arcy J.M. Cain wrote:
> On Tue, 30 Mar 2010 13:47:42 -0700 (PDT)
> ASh wrote:
>> Hi, please help me understand why am I getting error with this query
>>
>>
>> new_start_date = "NOW() - '29 days'::INTERVAL"
>> self.dyndb.orderdb.query('''update set creation_date
>> =
On Mar 31, 12:50 am, "D'Arcy J.M. Cain" wrote:
> On Tue, 30 Mar 2010 13:47:42 -0700 (PDT)
>
> ASh wrote:
> > Hi, please help me understand why am I getting error with this query
>
> > new_start_date = "NOW() - '29 days'::INTERVAL"
> > self.dyndb.orderdb.query('''update xxx
self.dyndb.orderdb.query('''update set creation_date
> > = %s
> > where id_order = %s''', (new_start_date, "123"))
>
> > ...
> > psycopg2.DataError: invalid input syntax for type timestamp with time
> > zone: "NO
On Tue, 30 Mar 2010 13:47:42 -0700 (PDT)
ASh wrote:
> Hi, please help me understand why am I getting error with this query
>
>
> new_start_date = "NOW() - '29 days'::INTERVAL"
> self.dyndb.orderdb.query('''update set creation_date
> = %s
> where id_order
e id_order = %s''', (new_start_date, "123"))
...
psycopg2.DataError: invalid input syntax for type timestamp with time
zone: "NOW() - '29 days'::INTERVAL"
Hi Anton,
It sounds to me like the problem is with your SQL rather than with
psycopg2 or Pyth
(new_start_date, "123"))
...
psycopg2.DataError: invalid input syntax for type timestamp with time
zone: "NOW() - '29 days'::INTERVAL"
--
http://mail.python.org/mailman/listinfo/python-list
> Would it hurt if you put in some extra information?
> http://www.timeanddate.com/library/abbreviations/timezones/
In theory, no. At work we still use the ancient Rogue Wave C++
libraries in a number of applications. It has hard-coded timezone
info so when the US changed the start and end of da
Would it hurt if you put in some extra information?
http://www.timeanddate.com/library/abbreviations/timezones/
HTH,
-Xav
P.S: You, sir, have an awesome first name.
On Mon, Feb 1, 2010 at 1:57 AM, Skip Montanaro wrote:
> > Does pytz know about CDT and CST?
>
> Nope...
>
> Skip
>
>
> --
> htt
> Does pytz know about CDT and CST?
Nope...
Skip
--
http://mail.python.org/mailman/listinfo/python-list
This may not answer your question directly, but have you thought about
ingoring the number at the end of these non-standard timezones? CDT is
Central Daylight-saving Timezone, while CST is Central Standard Timezone.
And you are correct they are -5 and -6 hours respectively. Does pytz know
about CDT
I have the pytz package but it doesn't know about non-standard timezone
names like "CDT5" or "CST6". I can obviously infer that they are either
five or six hours behind UTC. Are they constructed in some standard way so
that I can assume that if a timezone name is not known to pytz I can assume
t
On Tue, Sep 9, 2008 at 9:32 PM, <[EMAIL PROTECTED]> wrote:
> What's the simplest solution for formatting the output of local time
> in iso 8601 including the time zone information?
>
> Example:
>
>"2008-07-25T14:28:43.934-04:00"
You want the isoformat
What's the simplest solution for formatting the output of local time
in iso 8601 including the time zone information?
Example:
"2008-07-25T14:28:43.934-04:00"
Thanks,
Rowland
--
http://mail.python.org/mailman/listinfo/python-list
:
>>>
>>> How can I use the "PST" (or any other time zone name)
>>> to adjust dt by the
>>> correct number of hours to get it into UTC before storing in MySQL?
>> You could try mxDateTime's parser. It will convert most timezones
>> int
On Mar 11, 11:00 am, Jim Carroll <[EMAIL PROTECTED]> wrote:
(snipped)
>
> p.parse("10:29:52 Feb 29, 2008 PST", tzinfos=zones)
> datetime.datetime(2008, 2, 29, 10, 29, 52, tzinfo=tzoffset('PST', -28800))
>
> But I cannot figure out how to get dateutil to use the
> zoneinfo file that it includes in
M.-A. Lemburg egenix.com> writes:
>
> On 2008-03-07 22:24, Jim Carroll wrote:
> > It's taken me a couple of hours to give up on strptime
> > with %Z for recognizing
> > time zones... but that still leaves me in the wrong zone:
> >
> > How can
("%Y-%m-%d %H:%M")
>
>
> How can I use the "PST" (or any other time zone name) to adjust dt by the
> correct number of hours to get it into UTC before storing in MySQL?
You could try mxDateTime's parser. It will convert most timezones
into UTC for you:
>>
join(date_parts[:-1])
# eventually we need to apply the timezone
timezone = date_parts[-1]
dt = datetime.strptime(withouttz, "%H:%M:%S %b %d, %Y")
return dt.strftime("%Y-%m-%d %H:%M")
How can I use the "PST" (or any other time zone name) to adjust dt
how to set my mails recieving time to my local time(i am in malaysia)
--
http://mail.python.org/mailman/listinfo/python-list
42 matches
Mail list logo