Python ProgrammingPython Programming

Python get current date time without microsecond

from datetime import datetime

print(datetime.now().isoformat(' ', 'seconds'))
Output
2021-05-15 12:55:45