Skip to content

Instantly share code, notes, and snippets.

@Asday
Created February 28, 2020 10:43
Show Gist options
  • Save Asday/be44c79fa5ead8461e8da8da2b93c30e to your computer and use it in GitHub Desktop.
Save Asday/be44c79fa5ead8461e8da8da2b93c30e to your computer and use it in GitHub Desktop.
Python 3.8.1 (default, Dec 31 2019, 18:44:59)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> samoa = datetime.timezone(datetime.timedelta(hours=14))
>>> before = datetime.datetime(2011, 12, 29, tzinfo=samoa)
>>> before + datetime.timedelta(days=1)
datetime.datetime(2011, 12, 30, 0, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=50400)))
>>>
@Asday
Copy link
Author

Asday commented Mar 9, 2020

The conclusion is that, unsurprisingly, dates are bullshit, and the less anyone can have to do with them, the better. If someone else has written something to handle dates, use that.

We're Python. We shouldn't be scared of dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment