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