from datetime import datetime print(datetime.strptime(str(datetime.now()).split('.')[0],"%Y-%m-%d %H:%M:%S"))