tomorrow in yyyymmdd format

John La Rooy igetenoughspamalreadythanksjlr at doctor.com
Wed Aug 14 11:26:52 EDT 2002


Ralph Corderoy wrote:

>>from time import *
>>one_day = 60*60*24                       # number of seconds in day
>>   # make a julian for tomorrow -
>>   # note: depending on what you want be careful around midnight!
>>tomorrow = mktime(localtime()) + one_day
> 
> 
> What if now is 00:00 and today has a leap second or two?  60*60*24
> doesn't reach tomorrow.
> 
> Add one to the day argument to mktime().  That's why POSIX allowed you
> to do it and it is the normal way to do this kind of thing in C
> programs.  A lot of the complexity is hidden.
> 
> Cheers,
> 
> 
> Ralph.
> 
What if you actually tried it? Can you show us a counterexample?

John




More information about the Python-list mailing list