Re: Parsing a date-time string?

2005-12-23 Thread linda.s
Hi, I got the message of "There was an error in the DDE conversation with Pythonwin" when I tried to run Pythonwin. I googled and found the possible solution is: modify the Pythonwin shortcut to pass a "/nodde" command-line option. I got lost how to do that. Thanks for any help! -- http://mail.pyt

RE: Parsing a date-time string?

2005-12-23 Thread Leeuw van der, Tim
van der, Tim Cc: python-list@python.org Subject: Re: Parsing a date-time string?     On 21 Dec 2005 01:43:13 -0800, Tim N. van der Leeuw <[EMAIL PROTECTED]> wrote: Hi, I want to parse strings containing date-time, which look like the following: "Mon Dec 19 11:06:12:333 CET 200

Re: Parsing a date-time string?

2005-12-23 Thread Tim Roberts
"Tim N. van der Leeuw" <[EMAIL PROTECTED]> wrote: > >I want to parse strings containing date-time, which look like the >following: > > "Mon Dec 19 11:06:12:333 CET 2005" > >That's a problem for strptime it seems, b/c I cannot find any >format-spec for the milliseconds-part in here. (I'm also not su

Re: Parsing a date-time string?

2005-12-22 Thread Tim Williams (gmail)
On 21 Dec 2005 01:43:13 -0800, Tim N. van der Leeuw <[EMAIL PROTECTED]> wrote: Hi,I want to parse strings containing date-time, which look like thefollowing: "Mon Dec 19 11:06:12:333 CET 2005"[snipped]What I want to get is some sort of sortable date; either as a number or(if nothing else) as a str

Re: Parsing a date-time string?

2005-12-22 Thread Tim N. van der Leeuw
I downloaded the tar.bz2 file, extracted it, and had no problem building it and creating a windows installer using 'python ./setup.py bdist_wininst' This windows installer I then used to install it via the 'official windows' way :) luck, --Tim -- http://mail.python.org/mailman/listinfo/python-

Re: Parsing a date-time string?

2005-12-21 Thread Murtog (sent by Nabble.com)
y_number = s[3] In [9]: time = s[4] In [10]: # ? So you treat the datetime information using regex or another split method. Cheers =] Sent from the Python - python-list forum at Nabble.com: Re: Parsing a date-time string? -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing a date-time string?

2005-12-21 Thread linda.s
I did check and found 'dateutil' is under the folder of python-dateutil-1.0 very confused, :( On 12/21/05, linda.s <[EMAIL PROTECTED]> wrote: > Hi Fuzzyman, > I also wanted to install the DateUtil module from > http://labix.org/python-dateutil > but had problems (using Windows). > C:\Python24>pyth

Re: Parsing a date-time string?

2005-12-21 Thread linda.s
Hi Fuzzyman, I also wanted to install the DateUtil module from http://labix.org/python-dateutil but had problems (using Windows). C:\Python24>python python-dateutil-1.0\setup.py build running build running build_py error: package directory 'dateutil' does not exist Can you tell me why? Linda On 21

Re: Parsing a date-time string?

2005-12-21 Thread Fuzzyman
Quick response - there is a DateUtil module with a *very* flexible string-to-date parser. It will almost certainly do what you want : http://labix.org/python-dateutil All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml -- http://mail.python.org/mailman/listinfo/python-list

Parsing a date-time string?

2005-12-21 Thread Tim N. van der Leeuw
Hi, I want to parse strings containing date-time, which look like the following: "Mon Dec 19 11:06:12:333 CET 2005" That's a problem for strptime it seems, b/c I cannot find any format-spec for the milliseconds-part in here. (I'm also not sure about the validity of the tz part, but ...) As an

Re: parsing a date

2005-09-24 Thread Peter Hansen
Kalle Anke wrote: > Better (in this case) = > > + Being "pythonic" > > + Avoiding going through a second representation (the tuple) > if there is some way to create a date object directly. I think the plainest and simplest approach would be to create a well-named function which does the

Re: parsing a date

2005-09-24 Thread Kalle Anke
On Sat, 24 Sep 2005 16:06:06 +0200, Peter Hansen wrote (in article <[EMAIL PROTECTED]>): > Kalle Anke wrote: >> On Fri, 23 Sep 2005 23:01:18 +0200, Larry Bates wrote: >> >>> but I'm not sure it is "better". I guess it depends >>> on what you want to do with them after parsing. >> >> Sorry, I sh

Re: parsing a date

2005-09-24 Thread Peter Hansen
Kalle Anke wrote: > On Fri, 23 Sep 2005 23:01:18 +0200, Larry Bates wrote: > >>but I'm not sure it is "better". I guess it depends >>on what you want to do with them after parsing. > > Sorry, I should have been clearer. I want to parse the date and create a > 'date object' that is a part of lar

Re: parsing a date

2005-09-24 Thread Kalle Anke
On Fri, 23 Sep 2005 23:01:18 +0200, Larry Bates wrote (in article <[EMAIL PROTECTED]>): > but I'm not sure it is "better". I guess it depends > on what you want to do with them after parsing. Sorry, I should have been clearer. I want to parse the date and create a 'date object' that is a part

Re: parsing a date

2005-09-23 Thread Peter
Kalle Anke wrote: >I want to parse a date string, for example '2005-09-23', and since I haven't >done this before I would like to ask what is the best way to do it. > >I've looked around and the dateutil seems to be what most people use, but >unfortunately I only get an empty file when I try to

Re: parsing a date

2005-09-23 Thread Larry Bates
Better than a single line of code? What is it that you are looking for? If you dates are consistent you can do: year, month, day=map(int, d.split('-')) but I'm not sure it is "better". I guess it depends on what you want to do with them after parsing. -Larry Bates Kalle Anke wrote: > I want

parsing a date

2005-09-23 Thread Kalle Anke
I want to parse a date string, for example '2005-09-23', and since I haven't done this before I would like to ask what is the best way to do it. I've looked around and the dateutil seems to be what most people use, but unfortunately I only get an empty file when I try to download it. I also tri

Re: parsing a date string

2005-03-07 Thread Thomas Guettler
Am Sun, 06 Mar 2005 19:35:23 + schrieb MikeyG: > Hi, > > I have a date string in the ctime() format ('Sat Mar 5 10:38:07 2005') > and I want to know how long ago that was in whole days. > > So far I have: > > import time > import datetime > age = > (datetime.date.fromtimestamp(time.mktim

parsing a date string

2005-03-06 Thread MikeyG
Hi, I have a date string in the ctime() format ('Sat Mar 5 10:38:07 2005') and I want to know how long ago that was in whole days. So far I have: import time import datetime age = (datetime.date.fromtimestamp(time.mktime(time.strptime(date.strip( - datetime.date.today()).days Which is an