Skip to content

Instantly share code, notes, and snippets.

@Suhaib3100
Created December 4, 2024 09:16
Show Gist options
  • Save Suhaib3100/032e8aadc1511479b66cc866f261ce91 to your computer and use it in GitHub Desktop.
Save Suhaib3100/032e8aadc1511479b66cc866f261ce91 to your computer and use it in GitHub Desktop.
Ex 3 convert readable into timestamps
# Create a datetime object
dt = datetime(2024, 12, 4, 15, 0, 0)
# Convert datetime to timestamp
timestamp = dt.timestamp()
print("Timestamp:", timestamp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment