Skip to content

Instantly share code, notes, and snippets.

@Suhaib3100
Created December 4, 2024 09:19
Show Gist options
  • Save Suhaib3100/de5d6a0e9a27996317d5c7d7a1ef7242 to your computer and use it in GitHub Desktop.
Save Suhaib3100/de5d6a0e9a27996317d5c7d7a1ef7242 to your computer and use it in GitHub Desktop.
Example 4 formatting timestamps
# 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