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

Jon Clements joncle at googlemail.com
Tue Jul 21 17:09:31 EDT 2009


On 21 July, 22:00, davidj411 <davidj... at gmail.com> wrote:
> I am using a recursive function to print the time and a few other
> things on each pass. ( the function calculates size of file that is
> being transferred and if not 100 % copied, it waits 20 secs and checks
> again).
>
> i would expect the time to be correct anytime it is used:
>
> <--code below -->>
> print time.strftime('%m-%d-%Y %H:%m:%S')
> <--code above -->>
>
> here is an example of what i am seeing:
>
> 16:07:16
> 16:07:36
> 16:07:56
> 16:07:16
> 16:07:36
> 16:07:56
> 16:07:16
> 16:07:36
> 16:07:56

I assume month, day and year are actually being output and that you've
removed it from your post.

Err, what else do you expect to happen if you're doing this
recursively?



More information about the Python-list mailing list