From logs that my program wrote, I called 33,5k times datetime.now() and 35 times I got datetime in this format: 2012-01-27 21:28:31 and it is supposed to look like this: 2012-01-29 02:20:03.026000. Why this is happening?
UPDATE:
I found it when I wanted to do this: datetime.strptime(my_datetime_variable, "%Y-%m-%d %H:%M:%S.%f"). Of course I can use try/except and use format without .%f at the end, but I’m interested what is the reason of this behavior.
I would say it may not print microseconds if it happens to be exactly 0.