Run
import datetime # Get current date and time x = datetime.datetime.now() # Convert date and time to string dateTimeStr = str(x) # Print the date and time string print(dateTimeStr) # Print the type of dateTimeStr print(type(dateTimeStr))
Output