HomeDocs › %f

Python strftime directive %f

Microsecond as a decimal number, zero-padded to 6 digits (000000–999999).

Example (from datetime(2026, 6, 18, 13, 45, 30))
000000

In Python

from datetime import datetime
dt = datetime(2026, 6, 18, 13, 45, 30)
dt.strftime("%f")
# => "000000"

Parsing with strptime

Parses 1–6 fractional digits, right-padded to microseconds. See strptime.dev for the parsing side.

Try %f in the live tester →

Other Time directives