11👍
✅
Set microsecond
as 0:
t = timezone(settings.TIME_ZONE).localize(datetime.now()).replace(microsecond=0)
t.isoformat()
datetime.datetime.replace(...)
will return a new datetime
object with specified attribute modified.
Source:stackexchange.com