time.strftime('%m-%d-%Y %H:%m:%S') to log is out of order

Jon Clements joncle at googlemail.com
Tue Jul 21 17:52:57 EDT 2009


On 21 July, 22:38, Piet van Oostrum <p... at cs.uu.nl> wrote:
> >>>>> davidj411 <davidj... at gmail.com> (d) wrote:
> >d> I am using a recursive function to print the time and a few other
> >d> things on each pass. ( the function calculates size of file that is
> >d> being transferred and if not 100 % copied, it waits 20 secs and checks
> >d> again).
> >d> i would expect the time to be correct anytime it is used:
> >d> <--code below -->>
> >d> print time.strftime('%m-%d-%Y %H:%m:%S')
> >d> <--code above -->>
> >d> here is an example of what i am seeing:
> >d> 16:07:16
> >d> 16:07:36
> >d> 16:07:56
> >d> 16:07:16
> >d> 16:07:36
> >d> 16:07:56
> >d> 16:07:16
> >d> 16:07:36
> >d> 16:07:56
>
> You probably meant: print time.strftime('%m-%d-%Y %H:%M:%S')
> --
> Piet van Oostrum <p... at cs.uu.nl>
> URL:http://pietvanoostrum.com[PGP 8DAE142BE17999C4]
> Private email: p... at vanoostrum.org

Good spot!



More information about the Python-list mailing list