Source Code:
(back to article)
import datetime # Get the current date and time now = datetime.datetime.now() # Format the date and time for output output = now.strftime("%Y-%m-%d %H:%M:%S") print(output)
Result:
Report an issue