> Just to be picky - your function returns the number of days between
> two dates, but it's called isOld, which looks like it should return a
> boolean. i.e. it looks like it would be used as:
>
> if not isOld(auctionDate, currentTime):
> checkForBid()
>
> rather than how I assume it is used:
On Sep 12, 1:31 am, "Shawn Milochik" <[EMAIL PROTECTED]> wrote:
> > I suppose really oneDay should be a global (i.e. outside the function
> > definition). Apart from that it would be hard to improve on: obvious,
> > easy to read, in short - pythonic.
>
> > Are you concerned about daylight savings?
>
> I suppose really oneDay should be a global (i.e. outside the function
> definition). Apart from that it would be hard to improve on: obvious,
> easy to read, in short - pythonic.
>
> Are you concerned about daylight savings? That could certainly introduce
> a whole new level of complexity into
Shawn Milochik wrote:
> On 9/11/07, Grant Edwards <[EMAIL PROTECTED]> wrote:
>> On 2007-09-11, Shawn Milochik <[EMAIL PROTECTED]> wrote:
>>
>>> I have done what I wanted, but I think there must be a much better way.
>> See the strptime() function in either the time or the datetime
>> modules:
>>
>>
On 9/11/07, Grant Edwards <[EMAIL PROTECTED]> wrote:
> On 2007-09-11, Shawn Milochik <[EMAIL PROTECTED]> wrote:
>
> > I have done what I wanted, but I think there must be a much better way.
>
> See the strptime() function in either the time or the datetime
> modules:
>
> http://docs.python.org/lib/
Shawn Milochik a écrit :
> I have done what I wanted, but I think there must be a much better way.
>
> Given two timestamps in the following format, I just want to figure
> out how far apart they are (in days, seconds, whatever).
>
> Format:
>
> -MM-DD_MM:SS
>
> Example:
> 2007-09-11_16:41
On 2007-09-11, Shawn Milochik <[EMAIL PROTECTED]> wrote:
> I have done what I wanted, but I think there must be a much better way.
See the strptime() function in either the time or the datetime
modules:
http://docs.python.org/lib/module-time.html
http://docs.python.org/lib/module-datetime.html
I have done what I wanted, but I think there must be a much better way.
Given two timestamps in the following format, I just want to figure
out how far apart they are (in days, seconds, whatever).
Format:
-MM-DD_MM:SS
Example:
2007-09-11_16:41
It seems to me that to do what I want, I need