# 10 July 2021, 10:54:27AM
datetime.strftime("%-d %B %Y, %I:%M:%S%p")
# Python program to demonstrate strftime() function
from datetime import datetime as date
# Getting current date and time
now = date.now()
print("Without formatting", now)
# Example 1
s = now.strftime("%A %m %-Y")
print('
Example 1:', s)
# Example 2
s = now.strftime("%a %-m %y")
print('
Example 2:', s)
# Example 3
s = now.strftime("%-I %p %S")
print('
Example 3:', s)
# Example 4
s = now.strftime("%H:%M:%S")
print('
Example 4:', s)
import datetime
datetime.datetime.strptime("2022-1-25", '%Y-%m-%d').strftime('%m/%d/%y')