Re: Date Comparison

2009-02-04 Thread Colin J. Williams
Bill McClain wrote: On 2009-02-03, mohana2...@gmail.com wrote: Hi, I need to compare two dates and find the number of days between those two dates.This can be done with datetime module in python as below, but this is not supported in Jython. There are julian day routines in this astronomy pa

Re: Date Comparison

2009-02-03 Thread Mark Wooding
mohana2...@gmail.com writes: > I need to compare two dates and find the number of days between those > two dates.This can be done with datetime module in python as below, > but this is not supported in Jython. > > example > from datetime import date > a=datetime.date(2009,2,1) > b=datetime.date(2

Re: Date Comparison

2009-02-03 Thread Diez B. Roggisch
Simon Brunning wrote: > 2009/2/3 Diez B. Roggisch : >> Use the java API of java.util. > > Or better still, use Joda. > "dates compare you must?" SCNR. Didn't know of this incarnation of him... Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Date Comparison

2009-02-03 Thread Simon Brunning
2009/2/3 Diez B. Roggisch : > Use the java API of java.util. Or better still, use Joda. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: Date Comparison

2009-02-03 Thread Bill McClain
On 2009-02-03, mohana2...@gmail.com wrote: > Hi, > I need to compare two dates and find the number of days between those > two dates.This can be done with datetime module in python as below, > but this is not supported in Jython. There are julian day routines in this astronomy package: http

Re: Date Comparison

2009-02-03 Thread Diez B. Roggisch
mohana2...@gmail.com wrote: > Hi, > I need to compare two dates and find the number of days between those > two dates.This can be done with datetime module in python as below, > but this is not supported in Jython. > > example > from datetime import date > a=datetime.date(2009,2,1) > b=datetime.

Re: Date Comparison and Manipulation Functions?

2008-08-30 Thread W. eWatson
The author has updated the Tutorial and added a flex method. -- http://mail.python.org/mailman/listinfo/python-list

Re: Date Comparison and Manipulation Functions?

2008-08-30 Thread W. eWatson
John Machin wrote: On Aug 30, 10:41 am, "W. eWatson" <[EMAIL PROTECTED]> wrote: What I'm trying to do is adjust date-time stamped file names for date and time errors. The software program collects through a period that roughly coincides with night hours every day and according to the OS clock.

Re: Date Comparison and Manipulation Functions?

2008-08-30 Thread W. eWatson
W. eWatson wrote: John Machin wrote: On Aug 30, 10:41 am, "W. eWatson" <[EMAIL PROTECTED]> wrote: What I'm trying to do is adjust date-time stamped file names for date and time errors. The software program collects through a period that roughly coincides with night hours every day and accordi

Re: Date Comparison and Manipulation Functions?

2008-08-30 Thread W. eWatson
John Machin wrote: On Aug 30, 10:41 am, "W. eWatson" <[EMAIL PROTECTED]> wrote: What I'm trying to do is adjust date-time stamped file names for date and time errors. The software program collects through a period that roughly coincides with night hours every day and according to the OS clock.

Re: Date Comparison and Manipulation Functions?

2008-08-30 Thread Hendrik van Rooyen
John Machin wrote: >On Aug 30, 10:41 am, "W. eWatson" wrote: > >> What I'm trying to do is adjust date-time stamped file names for date and >> time errors. The software program collects through a period that roughly >> coincides with night hours every day and according to the OS clock. It >> so

Re: Date Comparison and Manipulation Functions?

2008-08-29 Thread John Machin
On Aug 30, 10:41 am, "W. eWatson" <[EMAIL PROTECTED]> wrote: > What I'm trying to do is adjust date-time stamped file names for date and > time errors. The software program collects through a period that roughly > coincides with night hours every day and according to the OS clock. It > sometimes h

Re: Date Comparison and Manipulation Functions?

2008-08-29 Thread W. eWatson
John Machin wrote: On Aug 30, 2:32 am, "W. eWatson" <[EMAIL PROTECTED]> wrote: I just tried the following code, and got an unexpected result. from pyfdate import * t = Time() ts = Time(2008, 8, 29,15,20,7) tnew = ts.plus(months=6) print "new date: ", tnew Result: new date: 2009-02-28 15:20:0

Re: Date Comparison and Manipulation Functions?

2008-08-29 Thread John Machin
On Aug 30, 2:32 am, "W. eWatson" <[EMAIL PROTECTED]> wrote: > I just tried the following code, and got an unexpected result. > > from pyfdate import * > t = Time() > > ts = Time(2008, 8, 29,15,20,7) > tnew = ts.plus(months=6) > print "new date: ", tnew > > Result: > new date: 2009-02-28 15:20:07 >

Re: Date Comparison and Manipulation Functions?

2008-08-29 Thread norseman
W. eWatson wrote: I just tried the following code, and got an unexpected result. from pyfdate import * t = Time() ts = Time(2008, 8, 29,15,20,7) tnew = ts.plus(months=6) print "new date: ", tnew Result: new date: 2009-02-28 15:20:07 I believe that should be April 1, 2009. If I use months = 1

Re: Date Comparison and Manipulation Functions?

2008-08-29 Thread W. eWatson
I just tried the following code, and got an unexpected result. from pyfdate import * t = Time() ts = Time(2008, 8, 29,15,20,7) tnew = ts.plus(months=6) print "new date: ", tnew Result: new date: 2009-02-28 15:20:07 I believe that should be April 1, 2009. If I use months = 1 and day =31, I ge

Re: Date Comparison and Manipulation Functions?

2008-08-27 Thread W. eWatson
John Machin wrote: On Aug 27, 11:24 am, "W. eWatson" <[EMAIL PROTECTED]> wrote: John Machin wrote: On Aug 27, 10:21 am, "W. eWatson" <[EMAIL PROTECTED]> wrote: I'm using IDLE for Python 2.4, and put pfydate distribution in C:\Python24\Lib\site-packages\pfydate, as required by the page. How to

Re: Date Comparison and Manipulation Functions?

2008-08-27 Thread John Machin
On Aug 27, 11:24 am, "W. eWatson" <[EMAIL PROTECTED]> wrote: > John Machin wrote: > > On Aug 27, 10:21 am, "W. eWatson" <[EMAIL PROTECTED]> wrote: > >> I'm using IDLE for Python 2.4, and put pfydate distribution in > >> C:\Python24\Lib\site-packages\pfydate, as required by the > >> page. > >> How

Re: Date Comparison and Manipulation Functions?

2008-08-26 Thread Benjamin Kaplan
On Tue, Aug 26, 2008 at 9:24 PM, W. eWatson <[EMAIL PROTECTED]> wrote: > John Machin wrote: > >> On Aug 27, 10:21 am, "W. eWatson" <[EMAIL PROTECTED]> wrote: >> >>> I'm using IDLE for Python 2.4, and put pfydate distribution in >>> C:\Python24\Lib\site-packages\pfydate, as required by the >>> pag

Re: Date Comparison and Manipulation Functions?

2008-08-26 Thread W. eWatson
John Machin wrote: On Aug 27, 10:21 am, "W. eWatson" <[EMAIL PROTECTED]> wrote: I'm using IDLE for Python 2.4, and put pfydate distribution in C:\Python24\Lib\site-packages\pfydate, as required by the page. How to install pyfdate. Save pyfdate.py into your PythonNN/Lib/site-packages direc

Re: Date Comparison and Manipulation Functions?

2008-08-26 Thread John Machin
On Aug 27, 10:21 am, "W. eWatson" <[EMAIL PROTECTED]> wrote: > > I'm using IDLE for Python 2.4, and put pfydate distribution in > C:\Python24\Lib\site-packages\pfydate, as required by the > page. > How to install pyfdate. > > Save pyfdate.py into your PythonNN/Lib/site-packages directory. > I

Re: Date Comparison and Manipulation Functions?

2008-08-26 Thread W. eWatson
[EMAIL PROTECTED] wrote: check out Pyfdate: http://www.ferg.org/pyfdate from pyfdate import * t = Time().add(hours=14) print "It is now", t.wdt datestring1 = "2005/10/05" #year,month,day datestring2 = "2002/09/22" #year,month,day datestring3 = "2007/11/11" #year,month,day year,month,day = num

Re: Date Comparison and Manipulation Functions?

2008-08-25 Thread W. eWatson
[EMAIL PROTECTED] wrote: check out Pyfdate: http://www.ferg.org/pyfdate from pyfdate import * t = Time().add(hours=14) print "It is now", t.wdt datestring1 = "2005/10/05" #year,month,day datestring2 = "2002/09/22" #year,month,day datestring3 = "2007/11/11" #year,month,day year,month,day = num

Re: Date Comparison and Manipulation Functions?

2008-08-24 Thread zuul
check out Pyfdate: http://www.ferg.org/pyfdate from pyfdate import * t = Time().add(hours=14) print "It is now", t.wdt datestring1 = "2005/10/05" #year,month,day datestring2 = "2002/09/22" #year,month,day datestring3 = "2007/11/11" #year,month,day year,month,day = numsplit(datestring1) # split

Re: Date Comparison and Manipulation Functions?

2008-08-24 Thread Paul Rudin
"W. eWatson" <[EMAIL PROTECTED]> writes: > Are there some date and time comparison functions that would compare, say, > > Is 10/05/05 later than 09/22/02? (or 02/09/22 format, yy/mm/dd) > Is 02/11/07 the same as 02/11/07? > > Is 14:05:18 after 22:02:51? (24 hour day is fine) > > How about the dat