Skip to content

Instantly share code, notes, and snippets.

@mfaughn
Created August 25, 2024 16:15
Show Gist options
  • Save mfaughn/35784a6593cdebc9aaec950c130b7e40 to your computer and use it in GitHub Desktop.
Save mfaughn/35784a6593cdebc9aaec950c130b7e40 to your computer and use it in GitHub Desktop.
from datetime import datetime, timedelta
now = datetime.now()
birthday = datetime(1972,2,11)
diff = now - birthday
# diff is type datetime.timedelta
# print(diff)
print('You are ' + str(diff.total_seconds()) + ' seconds old.')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment