f-string accelerates examples.utils.format_date() (#591)

This commit is contained in:
Christian Clauss
2022-07-12 18:26:47 +02:00
committed by GitHub
parent c580aac991
commit 19491d8010

View File

@@ -2,7 +2,7 @@ from datetime import datetime as dt
def format_date(dt_, fmt="%m/%d/%Y, %H:%M:%S"):
return dt_.strftime(fmt)
return f"{dt_:{fmt}}"
def now(fmt="%m/%d/%Y, %H:%M:%S"):