- https://whenever.readthedocs.io/en/latest/#why-use-whenever
whenever helps you write correct and type checked datetime code
Why use whenever ?
DST-safe arithmetic
Typesafe API prevents common bugs
Fixes issues arrow/pendulum don’t
Based on proven and familiar concepts
️ Unmatched performance
Thoroughly tested and documented
Support for date arithmetic
Since, it is almost that time of year:
If you are in the U.S., are you for or against abolishing Daylight Saving Time (DST)?
Are there "names" for the different date time notations like
US: month, day, year
Europe: day, month, year
US: 12 hr with AM/PM
Other places : 24 hrs
Iso standard
Etc?
If there are names for these different notations maybe we could add them as Python enums and use the enum instead of constructing our own "%m %d %Y" whatever.
Wouldn't that be interesting? Might solve lots of bugs with wrong datetime format.
@browniebroke @treyhunner
I recommend @adamchainz's neat "import datetime as dt" trick to solve that:
https://adamj.eu/tech/2019/09/12/how-i-import-pythons-datetime-module/ #python #datetime
The Time Lords have a special torture chamber on Gallifrey for app developers that write apps, used cross timezones but dont properly store timezone data.
#timezone #datetime #dev #programming #utc #doctorwho #timelords
https://spacenews.com/white-house-directs-nasa-to-develop-lunar-time-standard/
Another time zone?!
I can't wait to see how datetime is affected.
Hoje eu aprendi a converter um #datetimestamp unix em uma data legível com #Python #datetime
from datetime import datetime
ts = int('1284101485')
# if you encounter a "year is out of range" error the timestamp
# may be in milliseconds, try `ts /= 1000` in that case
print(datetime.utcfromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S'))
Do you ever visit the Python datetime docs specifically to look up those percent formatting codes?
Good news!
I've added a handy shortcut at the top to take you directly there!
Is it possible to get a zoneinfo.ZoneInfo key (i.e.: IANA tzdb identifier) for the current system timezone, in Python? `datetime.now(timezone.utc).astimezone().` gives a potentially ambiguous 'tzname' and 'utcoffset' which make it difficult to communicate long-term time intervals to other systems
So what's the easiest way to handle time and date data with timezone information in #python (#pandas, #datetime, #numpy, or #xarray). I find myself switching back and forth between datetime64, Timestamp, adding timedelta or tzinfo haphazardly and have never really settled on what's the best way to handle these data. I'm primarily working with pandas dataframes or xarray datasets. #programmingHelp
"Understanding Python Datetime Handling — Cloud Academy"
Valery C. Briz (@valerybriz)
https://dev.to/valerybriz/understanding-python-datetime-handling-cloud-academy-2ob2