At 06:29 AM 4/17/2008, Kent Johnson wrote: >Dick Moores wrote: > >>>You could either create n with hours=minutes=0, or round the >>>difference up to the next whole number of days. >>I have no idea how to implement either of your suggestions as to >>how to eliminate it. Could you please spell them both out? > >1. > >In [17]: n=datetime.today() >In [18]: n=datetime(n.year, n.month, n.day) >In [19]: n >Out[19]: datetime.datetime(2008, 4, 17, 0, 0) > >2. > >In [20]: diff=y-n >In [21]: diff >Out[21]: datetime.timedelta(0, 57464, 721369) >In [22]: days = diff.days >In [23]: if diff.seconds or diff.microseconds: > ....: days += 1 > ....: > ....: >In [24]: days >Out[24]: 1
Thanks, Kent. So here's where I am now: <http://py77.python.pastebin.com/f5da44111> The script calculates correctly, but note the output, lines 34, 39, 49, 53. Please show me how to print these in the form 4/17/2007. I've tried everything I could think of. Dick ================================ UliPad <<The Python Editor>>: http://code.google.com/p/ulipad/ _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor