https://github.com/dcramer/sexytime
https://github.com/dcramer/sexytime
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dcramer/sexytime
- Owner: dcramer
- License: apache-2.0
- Created: 2011-08-16T21:42:21.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2011-08-16T22:28:10.000Z (almost 14 years ago)
- Last Synced: 2025-02-06T11:18:58.063Z (4 months ago)
- Language: Python
- Homepage:
- Size: 93.8 KB
- Stars: 25
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
``sexytime`` is a replacement for stdlib's ``datetime`` module. It replaces datetime.datetime.{now,utcnow} with functions that are guaranteed to return UTC timezone aware datetime objects.
Usage
=====The module behaves identical to stdlib's ``datetime``::
>>> from sexytime import datetime
>>> datetime.utcnow()
datetime.datetime(2011, 8, 16, 22, 24, 26, 116079, tzinfo=)You can also completely replace the datetime by monkey patching it. This requires you to execute it before you import datetime submodules elsewhere::
import sexytime.monkey
sexytime.monkey.patch()