handle japanese time format
Project description
jptime
jptime handle japanese time format.
Installation
pip install jptime
Usage
from datetime import datetime
import jptime
# from string
jpt = jptime.from_str("平成元年三月三日")
assert jpt.to_tuple() == (4, 1, 3, 3)
assert jpt.to_datetime() == datetime(1989, 3, 3)
# from datetime
jpt = jptime.from_datetime(datetime(2019, 5, 1))
assert jpt.to_tuple() == (5, 1, 5, 1) # 令和1年5月1日
Supported formats
- japanese era
- era_symbol/yy/mm/dd (allow kanji number) (e.g. 昭和5年3月3日)
- era_code + yymmdd (e.g. 3031123, H040323)
- christian era (delegate to dateutil.parser) (e.g. 19920323, 2018-12-12, 2018年8月13日)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jptime-1.1.0.tar.gz
(4.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jptime-1.1.0.tar.gz.
File metadata
- Download URL: jptime-1.1.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.6 CPython/3.8.12 Linux/5.11.0-1021-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
824e5d2585ac62c8570e193496c9a503d997423a7f8f7463a68f6b686f3dc306
|
|
| MD5 |
c93f887bc5edb618ba95955a762029a5
|
|
| BLAKE2b-256 |
3551e9c5c96a46242bd70ee14d0b144fd012f703cfa139de58c6c3d97097df2c
|
File details
Details for the file jptime-1.1.0-py3-none-any.whl.
File metadata
- Download URL: jptime-1.1.0-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.6 CPython/3.8.12 Linux/5.11.0-1021-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8adfcaf1f7ad2d7cbf4d2e7034285273c69b52da1f7ff45a0448420a1ec9ce53
|
|
| MD5 |
6d97be3dbdf57c2e34fef56da40e1762
|
|
| BLAKE2b-256 |
6b015e6639961e02cd3b564ef5d7b953976745081059ce7575cef4c44c400c48
|