Created
December 4, 2024 09:19
-
-
Save Suhaib3100/de5d6a0e9a27996317d5c7d7a1ef7242 to your computer and use it in GitHub Desktop.
Example 4 formatting timestamps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the current datetime | |
now = datetime.now() | |
# Format it into a readable string | |
formatted_date = now.strftime("%Y-%m-%d %H:%M:%S") | |
print("Formatted Date:", formatted_date) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment