Comparing dates problem

John Machin sjmachin at lexicon.net
Wed May 9 18:12:44 EDT 2007


On May 10, 7:34 am, kyoso... at gmail.com wrote:
> Hi,
>
> I am writing a reminder program for our Zimbra email client. One of
> the requirements I was given was to automatically increment or
> decrement the display to show something like the following:
>
> 5 minutes until appointment
>
> or
>
> 10 minutes past your appointment
>
> Either way, as each minute goes by, I need to increment it or
> decrement it. I am having trouble finding a coherent way to take the
> same date and compare just the number of minutes between them to find
> the difference. Like if I have an appointment at 9:30 a.m. and the app
> is loaded at 8 a.m., I need to know the number of minutes or hours and
> minutes until the appointment.
>
> I have looked at the dateutils module and it has many comparison
> methods, but they seem to only return the number of days or seconds.
>

Ermmm ... what's wrong with

minutes = seconds / 60.0
hours = minutes / 60.0

?






More information about the Python-list mailing list