Source Code:
(back to article)
from datetime import datetime Datum = datetime(2022, 1, 1) subtrahiertes_Datum = date.replace(day=date.day-1) print(subtrahiertes_Datum) # Ausgabe: 2022-01-31 00:00:00
Result:
Report an issue