https://github.com/pykit3/k3time
Time convertion utils
https://github.com/pykit3/k3time
date time timestamp
Last synced: 4 months ago
JSON representation
Time convertion utils
- Host: GitHub
- URL: https://github.com/pykit3/k3time
- Owner: pykit3
- License: mit
- Created: 2020-05-26T12:42:15.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-08-28T12:38:37.000Z (9 months ago)
- Last Synced: 2025-09-22T09:59:47.732Z (8 months ago)
- Topics: date, time, timestamp
- Language: Python
- Homepage: https://blog.openacid.com
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# k3time
[](https://github.com/pykit3/k3time/actions/workflows/python-package.yml)
[](https://k3time.readthedocs.io/en/stable/?badge=stable)
[](https://pypi.org/project/k3time)
Time convertion utils
k3time is a component of [pykit3] project: a python3 toolkit set.
Time convertion utils.
>>> parse('2017-01-24T07:51:59.000Z', 'iso')
datetime.datetime(2017, 1, 24, 7, 51, 59)
>>> format_ts(1485216000, 'iso')
'2017-01-24T00:00:00.000Z'
>>> format_ts(1485216000, '%Y-%m-%d')
'2017-01-24'
# Install
```
pip install k3time
```
# Synopsis
```python
>>> parse('2017-01-24T07:51:59.000Z', 'iso')
datetime.datetime(2017, 1, 24, 7, 51, 59)
>>> format_ts(1485216000, 'iso')
'2017-01-24T00:00:00.000Z'
>>> format_ts(1485216000, '%Y-%m-%d')
'2017-01-24'
```
# Author
Zhang Yanpo (张炎泼)
# Copyright and License
The MIT License (MIT)
Copyright (c) 2015 Zhang Yanpo (张炎泼)
[pykit3]: https://github.com/pykit3