Python strftime directive %V
ISO 8601 week number (01–53). Use with %G and %u.
Example (from datetime(2026, 6, 18, 13, 45, 30))
25
In Python
from datetime import datetime
dt = datetime(2026, 6, 18, 13, 45, 30)
dt.strftime("%V")
# => "25"
Parsing with strptime
Parses an ISO week; requires %G and %u. See strptime.dev for the parsing side.