Python program to print the current date

In this python basic program, we will print the current date in the format given int the question.

Steps to solve the program
  1. Import datetime.
  2. Using datetime get the current date with the help of datetime.datetime.now().
  3. 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 
				
			

calculate simple interest.

Calculate days between 2 dates.

Leave a Comment