In this python basic program, we will print the current date in the format given int the question.
Steps to solve the program
- Import datetime.
- Using datetime get the current date with the help of datetime.datetime.now().
- Print the current date in the required format using date.strftime().
import datetime
date = datetime.datetime.now()
print (date.strftime (" %Y %b %d "))
Output :
2023 Jan 28