mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 18:27:29 -05:00
f-string accelerates examples.utils.format_date() (#591)
This commit is contained in:
@@ -2,7 +2,7 @@ from datetime import datetime as dt
|
|||||||
|
|
||||||
|
|
||||||
def format_date(dt_, fmt="%m/%d/%Y, %H:%M:%S"):
|
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"):
|
def now(fmt="%m/%d/%Y, %H:%M:%S"):
|
||||||
|
|||||||
Reference in New Issue
Block a user