1 >>>import datetime 2 >>>d = datetime.datetime.now().replace(microsecond=0) 3 >>>d 4 datetime.datetime(2019, 4, 2, 15, 55, 18)