from datetime import datetime date = datetime.now().strftime("%d%m%Y%H%M%S") datef = datetime.now().strftime("%d-%m-%y %H:%M:%S") print(datef)