Formatting dates in Python using f-strings

from datetime import datetimedate = datetime(2022, 5, 27, 11, 44)print(f'Your appointment is schedule to start at {date:%I:%M %p} on {date:%Y-%m-%d}.', 'Be there!', sep='\n')
Your appointment is schedule to start at 11:44 AM on 2022-05-27.
Be there!

--

--

--

A Brazilian data engineer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Selenium dockerization, and integration in CI

Correctly Sized Docker Containers

Ever Been Blackmailed By A Developer

Explaining Germany’s Dependency On The Russian Gas Through the Software Concept of Tight Coupling

Kotlin test environment

DeFi11 — Telegram AMA — September 15

Building Apps with Plug: Levels 1 to 3!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Patrick Heinz

Patrick Heinz

A Brazilian data engineer

More from Medium

Python program to convert the temperature in degree centigrade to Fahrenheit

degree to fahrenheit ,centigrade fahrenheit conversion ,python program to convert celsius to fahrenheit

Build Components in Python for Keboola (Tutorial)

Automatically Copy the Output of a Python Program Easily

A Beginner’s Guide to Basic Python