Skip to content

Instantly share code, notes, and snippets.

@daejinseok
Created July 20, 2021 08:54
Show Gist options
  • Save daejinseok/ee74f8b170b6d92b325a513b9b16522f to your computer and use it in GitHub Desktop.
Save daejinseok/ee74f8b170b6d92b325a513b9b16522f to your computer and use it in GitHub Desktop.
python, datetime example
import datetime
datetime.datetime.today()
# datetime.datetime(2021, 7, 20, 17, 48, 37, 529267)
datetime.datetime(2021, 9, 3) - datetime.timedelta(days=30)
# datetime.datetime(2021, 8, 4, 0, 0)
datetime.datetime.today() - datetime.datetime(2021, 9, 3)
# datetime.timedelta(days=-45, seconds=64206, microseconds=234744)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment