datetime, time zone and xs:datetime

2016-08-26 Thread Nagy László Zsolt
[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

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: Time zone changing while Win app is running

2013-04-03 Thread CM
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

Re: Time zone changing while Win app is running

2013-04-03 Thread Terry Jan Reedy
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

Re: Time zone changing while Win app is running

2013-04-03 Thread CM
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

Re: Time zone changing while Win app is running

2013-04-03 Thread CM
> 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

Re: Time zone changing while Win app is running

2013-04-03 Thread Steven D'Aprano
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

Time zone changing while Win app is running

2013-04-02 Thread CM
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 current time zone in Python in tzinfo format not implemented

2010-11-28 Thread John Nagle
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

Re: problem with strptime and time zone

2010-08-25 Thread Alex Willmer
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

Re: problem with strptime and time zone

2010-08-25 Thread Lawrence D'Oliveiro
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?

Re: problem with strptime and time zone

2010-08-24 Thread m_ahlenius
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

Re: problem with strptime and time zone

2010-08-24 Thread Chris Rebert
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

Re: problem with strptime and time zone

2010-08-24 Thread Alex Willmer
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

problem with strptime and time zone

2010-08-24 Thread m_ahlenius
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 

Re: psycopg2 / psycopg2.DataError: invalid input syntax for type timestamp with time zone:

2010-03-31 Thread Anton Shishkov
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,

Re: psycopg2 / psycopg2.DataError: invalid input syntax for type timestamp with time zone:

2010-03-31 Thread Anton Shishkov
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

Re: psycopg2 / psycopg2.DataError: invalid input syntax for type timestamp with time zone:

2010-03-31 Thread Michael Ricordeau
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

Re: psycopg2 / psycopg2.DataError: invalid input syntax for type timestamp with time zone:

2010-03-30 Thread D'Arcy J.M. Cain
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

Re: psycopg2 / psycopg2.DataError: invalid input syntax for type timestamp with time zone:

2010-03-30 Thread Steve Holden
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 >> =

Re: psycopg2 / psycopg2.DataError: invalid input syntax for type timestamp with time zone:

2010-03-30 Thread ASh
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

Re: psycopg2 / psycopg2.DataError: invalid input syntax for type timestamp with time zone:

2010-03-30 Thread ASh
   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

Re: psycopg2 / psycopg2.DataError: invalid input syntax for type timestamp with time zone:

2010-03-30 Thread D'Arcy J.M. Cain
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

Re: psycopg2 / psycopg2.DataError: invalid input syntax for type timestamp with time zone:

2010-03-30 Thread Philip Semanchuk
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

psycopg2 / psycopg2.DataError: invalid input syntax for type timestamp with time zone:

2010-03-30 Thread ASh
(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

Re: How to get UTC offset for non-standard time zone names?

2010-01-31 Thread Skip Montanaro
> 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

Re: How to get UTC offset for non-standard time zone names?

2010-01-31 Thread Xavier Ho
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

Re: How to get UTC offset for non-standard time zone names?

2010-01-31 Thread Skip Montanaro
> Does pytz know about CDT and CST? Nope... Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get UTC offset for non-standard time zone names?

2010-01-31 Thread Xavier Ho
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

How to get UTC offset for non-standard time zone names?

2010-01-31 Thread skip
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

Re: Simplest solution for formatting local time in iso 8601 including time zone.

2008-09-09 Thread Chris Rebert
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

Simplest solution for formatting local time in iso 8601 including time zone.

2008-09-09 Thread rowland
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

Re: Time Zone application after strptime?

2008-03-12 Thread M.-A. Lemburg
: >>> >>> 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

Re: Time Zone application after strptime?

2008-03-11 Thread [EMAIL PROTECTED]
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

Re: Time Zone application after strptime?

2008-03-11 Thread Jim Carroll
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

Re: Time Zone application after strptime?

2008-03-07 Thread M.-A. Lemburg
("%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: >>

Time Zone application after strptime?

2008-03-07 Thread Jim Carroll
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

time zone

2004-12-22 Thread Kiran Vasu
how to set my mails recieving time to my local time(i am in malaysia) -- http://mail.python.org/mailman/listinfo/python-list