[Tutor] time comparison question

Anna Ravenscroft revanna at mn.rr.com
Fri Nov 26 14:22:54 CET 2004


Liam Clarke wrote:
> Hi Brian, 
> 
> I was in a similar position to you 3 weeks ago, and I was using
> time.time, and time.gmtime.

<snip>
> Guess which one I went with?
> My original code was brute forcish, unmaintainable & ugly, but it
> worked when I wrote it. Sounds like Perl really. But notice that I had
> to use an object anyway to invoke timedelta, so all my messing around
> was in vain.

Sounds like my first work with dates. (That was back before we had 
datetime.)

> Highly recommend this - 
> 
> a) Use the datetime module
> b) Use datetime objects, so you don't have to mess around with
> functions that require 9 digit tuples
> c) Listen to Kent if he posts, he's good. 
> 
> 
> Give datetime a try, and see how it goes.

Great answer. I agree, especially with the "listen to Kent" part. ;-)

Anna



More information about the Tutor mailing list