Python program to get the current date using datetime.

In this python basic program, we will get the current date and time using datetime library.

Steps to solve the program
  1. Import datetime library.
  2. Get the current date and time using datetime.datetime.now().
  3. Print the output.
				
					import datetime   
dt = datetime.datetime.now() 

print("Current Date: ",dt)
				
			

Output :

				
					Current Date:  2023-01-29 09:52:33.631419
				
			

generate a random string with a specific length.

convert Decimal to Binary.

Leave a Comment