cs.dateutils-20230210
توضیحات
A few conveniences to do with dates and times.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | cs.dateutils-20230210 |
| نام | cs.dateutils |
| نسخه کتابخانه | 20230210 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Cameron Simpson |
| ایمیل نویسنده | Cameron Simpson <cs@cskk.id.au> |
| آدرس صفحه اصلی | https://bitbucket.org/cameron_simpson/css/commits/all |
| آدرس اینترنتی | https://pypi.org/project/cs.dateutils/ |
| مجوز | GNU General Public License v3 or later (GPLv3+) |
A few conveniences to do with dates and times.
*Latest release 20230210*:
* Drop Python 2 support.
* Make timezones mandatory where previously they were assumed.
There are some other PyPI modules providing richer date handling
than the stdlib `datetime` module.
This module mostly contains conveniences used in my other code;
you're welcome to it, but it does not pretend to be large or complete.
## Function `datetime2unixtime(dt)`
Convert a timezone aware `datetime` to a UNIX timestamp.
## Function `isodate(when=None, dashed=True)`
Return a date in ISO8601 YYYY-MM-DD format, or YYYYMMDD if not `dashed`.
Modern Pythons have a `datetime.isoformat` method, you use that.
## Function `localdate2unixtime(d)`
Convert a localtime `date` into a UNIX timestamp.
## Class `tzinfoHHMM(datetime.tzinfo)`
tzinfo class based on +HHMM / -HHMM strings.
## Function `unixtime2datetime(unixtime, *, tz: datetime.tzinfo)`
Convert a a UNIX timestamp to a `datetime` in the timezone `tz`.
## Class `UNIXTimeMixin`
A mixin for classes with a `.unixtime` attribute,
a `float` storing a UNIX timestamp.
# Release Log
*Release 20230210*:
* Drop Python 2 support.
* Make timezones mandatory where previously they were assumed.
*Release 20210306*:
Initial release, used by cs.sqltags.
نحوه نصب
نصب پکیج whl cs.dateutils-20230210:
pip install cs.dateutils-20230210.whl
نصب پکیج tar.gz cs.dateutils-20230210:
pip install cs.dateutils-20230210.tar.gz