Created
February 28, 2020 10:43
-
-
Save Asday/be44c79fa5ead8461e8da8da2b93c30e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))) | |
>>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.