# strftime With Microseconds

The method strftime in ‵timemodule does not support format time with microseconds. Instead, one can use another methodstrftime` in standard module ‵datetime‵ which support format time with microseconds.

from datetime import datetime
now = datetime.now()
now.strftime("%y/%m/%d %H:%M:%S.%f")
"""output
'22/05/31 00:11:49.279957'
”“”
(adsbygoogle = window.adsbygoogle || []).push({});
### 参考资料 > - [1.https://stackoverflow.com/questions/6677332/using-f-with-strftime-in-python-to-get-microseconds](https://stackoverflow.com/questions/6677332/using-f-with-strftime-in-python-to-get-microseconds)