Re: date and time comparison how to

2012-11-02 Thread Adam Tauno Williams
On Mon, 2012-10-29 at 16:13 -0700, noydb wrote: > All, > I need help with a date and time comparison. > Say a user enters a date-n-time and a file on disk. I want to compare > the date and time of the file to the entered date-n-time; if the file > is newer than the entered date-n-time, add the fil

RE: date and time comparison how to

2012-10-31 Thread Prasad, Ramit
Gary Herron wrote: > On 10/29/2012 04:13 PM, noydb wrote: > > All, > > > > I need help with a date and time comparison. > > > > Say a user enters a date-n-time and a file on disk. I want to compare the > > date and time of the file to the > entered date-n-time; if the file is newer than the enter

Re: date and time comparison how to

2012-10-30 Thread Dave Angel
On 10/30/2012 12:20 AM, noydb wrote: > On Monday, October 29, 2012 11:11:55 PM UTC-4, Dave Angel wrote: >> On 10/29/2012 10:13 PM, noydb wrote: >> >>> I guess I get there eventually! >> >>> >> >> > > okay, I see. > But for the user supplied date... I'm not sure of the format just yet... > test

Re: date and time comparison how to

2012-10-29 Thread Chris Angelico
On Tue, Oct 30, 2012 at 3:20 PM, noydb wrote: > But for the user supplied date... I'm not sure of the format just yet... > testing with a string for now (actual date-date might be possible, tbd > later), so like '10292012213000' (oct 29, 2012 9:30pm). How would you get > that input into a form

Re: date and time comparison how to

2012-10-29 Thread noydb
On Monday, October 29, 2012 11:11:55 PM UTC-4, Dave Angel wrote: > On 10/29/2012 10:13 PM, noydb wrote: > > > I guess I get there eventually! > > > This seems to work > > > > > > pdf_timeStamp = > > time.strftime("%m%d%y%H%M%S",time.localtime(os.path.getmtime(pdf))) > > > intermedia

Re: date and time comparison how to

2012-10-29 Thread MRAB
On 2012-10-30 03:11, Dave Angel wrote: On 10/29/2012 10:13 PM, noydb wrote: I guess I get there eventually! This seems to work pdf_timeStamp = time.strftime("%m%d%y%H%M%S",time.localtime(os.path.getmtime(pdf))) intermediateTime = time.strptime(pdf_timeStamp, "%m%d%y%H%M%S") pdfFile

Re: date and time comparison how to

2012-10-29 Thread Dave Angel
On 10/29/2012 10:13 PM, noydb wrote: > I guess I get there eventually! > This seems to work > > pdf_timeStamp = > time.strftime("%m%d%y%H%M%S",time.localtime(os.path.getmtime(pdf))) > intermediateTime = time.strptime(pdf_timeStamp, "%m%d%y%H%M%S") > pdfFile_compareTime = time.mktime(

Re: date and time comparison how to

2012-10-29 Thread noydb
I guess I get there eventually! This seems to work pdf_timeStamp = time.strftime("%m%d%y%H%M%S",time.localtime(os.path.getmtime(pdf))) intermediateTime = time.strptime(pdf_timeStamp, "%m%d%y%H%M%S") pdfFile_compareTime = time.mktime(intermediateTime) (and I'll do the same to the us

Re: date and time comparison how to

2012-10-29 Thread noydb
if I do time.time() I get 1351562187.757, do it again I get 1351562212.2650001 --- so I can compare those, the latter is later then the former. Good. SO how do I turn pdf_timeStamp (a string) above into time in this (as from time.time()) format? Am I on the right track -- is that the way to d

Re: date and time comparison how to

2012-10-29 Thread noydb
Thanks, I did find this... pdf_timeStamp = time.strftime("%m%d%y%H%M%S",time.localtime(os.path.getmtime(pdf))) >> pdf_timestamp >> '102909133000' ... but now how to do the comparison? Cannot just do a raw string comparison, gotta declare it a date -- http://mail.python.org/mailman/listinfo/p

Re: date and time comparison how to

2012-10-29 Thread MRAB
On 2012-10-30 00:04, Gary Herron wrote: On 10/29/2012 04:13 PM, noydb wrote: All, I need help with a date and time comparison. Say a user enters a date-n-time and a file on disk. I want to compare the date and time of the file to the entered date-n-time; if the file is newer than the entere

Re: date and time comparison how to

2012-10-29 Thread Gary Herron
On 10/29/2012 04:13 PM, noydb wrote: All, I need help with a date and time comparison. Say a user enters a date-n-time and a file on disk. I want to compare the date and time of the file to the entered date-n-time; if the file is newer than the entered date-n-time, add the file to a list to

date and time comparison how to

2012-10-29 Thread noydb
All, I need help with a date and time comparison. Say a user enters a date-n-time and a file on disk. I want to compare the date and time of the file to the entered date-n-time; if the file is newer than the entered date-n-time, add the file to a list to process. How best to do? I have looke