python f-string format date

44

python f-string format date -

import datetime
now = datetime.datetime.now()
print(f'{now:%Y-%m-%d %H:%M}')

Comments

Submit
0 Comments