scidatetime


Namescidatetime JSON
Version 1.19.20 PyPI version JSON
download
home_pagehttps://github.com/serfend/scidatetime
Summaryscidatetime is python module for DateTime handle.
upload_time2024-02-19 00:00:51
maintainer
docs_urlNone
authorserfend
requires_python>=3.9, <4
licenseMIT Licence
keywords lib utils
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            

<p align="center">
    <a href="https://visitorbadge.io/status?path=https%3A%2F%2Fgithub.com%2Fserfend%2Fscidatetime%2F"><img src="https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Fgithub.com%2Fserfend%2Fscidatetime%2F&labelColor=%23697689&countColor=%23ff8a65&style=plastic&labelStyle=none" /></a> 
    <a href="https://pypi.python.org/pypi/scidatetime/"><img alt="pypi version" src="https://img.shields.io/pypi/v/scidatetime.svg" /></a> 
    <a href="https://pypistats.org/packages/scidatetime"><img alt="pypi download" src="https://img.shields.io/pypi/dm/scidatetime.svg" /></a>
    <a href="https://github.com/serfend/scidatetime/releases"><img alt="GitHub release" src="https://img.shields.io/github/release/serfend/scidatetime.svg?style=flat-square" /></a>
    <a href="https://github.com/serfend/scidatetime/releases"><img alt="GitHub All Releases" src="https://img.shields.io/github/downloads/serfend/scidatetime/total.svg?style=flat-square&color=%2364ff82" /></a>
    <a href="https://github.com/serfend/scidatetime/commits"><img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/serfend/scidatetime.svg?style=flat-square" /></a>
    <a href="https://github.com/serfend/scidatetime/actions/workflows/pytest.yml"><img alt="GitHub Workflow Status" src="https://github.com/serfend/scidatetime/actions/workflows/pytest.yml/badge.svg" /></a>
</p>




![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white)![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black)![Ubuntu](https://img.shields.io/badge/Ubuntu-E95420?style=for-the-badge&logo=ubuntu&logoColor=white)![Kali](https://img.shields.io/badge/Kali-268BEE?style=for-the-badge&logo=kalilinux&logoColor=white)![FreeBSD](https://img.shields.io/badge/-FreeBSD-%23870000?style=for-the-badge&logo=freebsd&logoColor=white)![Deepin](https://img.shields.io/badge/Deepin-007CFF?style=for-the-badge&logo=deepin&logoColor=white)![Debian](https://img.shields.io/badge/Debian-D70A53?style=for-the-badge&logo=debian&logoColor=white)![Cent OS](https://img.shields.io/badge/cent%20os-002260?style=for-the-badge&logo=centos&logoColor=F0F0F0)

# What?

scidatetime is python module for DateTime handle.



## Install

```shell
pip install scidatetime
```



## Usage

```python
from scidatetime import DateTime
# 当前时间
print(DateTime()) # 2023-09-19 14:50:43.570560+08:00
# 指定日期
print(DateTime('2023-09-19')) # 2023-09-19 00:00:00+08:00
# 指定时间
print(DateTime('2023-09-19 14:50:43')) # 2023-09-19 14:50:43+08:00
# 指定时间戳
print(DateTime(1695106243000)) # 2023-09-19 14:50:43+08:00
# 指定时间及时区
print(DateTime('2023-09-19T14:50:43+07:00')) # 2023-09-19 14:50:43+07:00

# 计算时间差
print((DateTime('2023-09-20') - '2023-09-19').total_seconds()) # 86400.0
print((DateTime('2023-09-20') - 60 * 1000)) # 2023-09-19 23:59:00+08:00

# 获取相对时间
print(DateTime('2023-09-20').toRelativeTime('2023-09-20 14:23')) # 14小时前
print(DateTime('2023-09-20 10:00:00').toRelativeTime('2023-09-20 10:01:00')) # 1分钟后
print(DateTime('2023-01-20 10:00:00').toRelativeTime()) # xxx年前
```





## Status

![Alt](https://repobeats.axiom.co/api/embed/05f8549ceb608c78dfa4b74d83d61b0812bf7cd8.svg "Repobeats analytics image")

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/serfend/scidatetime",
    "name": "scidatetime",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9, <4",
    "maintainer_email": "",
    "keywords": "lib,utils",
    "author": "serfend",
    "author_email": "serfend@foxmail.com",
    "download_url": "https://files.pythonhosted.org/packages/3c/86/e407b4cfe5a248c9ac2a2589d560a01bc9ace5b6be212f54ea7d5b3b8e90/scidatetime-1.19.20.tar.gz",
    "platform": "any",
    "description": "\n\n<p align=\"center\">\n    <a href=\"https://visitorbadge.io/status?path=https%3A%2F%2Fgithub.com%2Fserfend%2Fscidatetime%2F\"><img src=\"https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Fgithub.com%2Fserfend%2Fscidatetime%2F&labelColor=%23697689&countColor=%23ff8a65&style=plastic&labelStyle=none\" /></a> \n    <a href=\"https://pypi.python.org/pypi/scidatetime/\"><img alt=\"pypi version\" src=\"https://img.shields.io/pypi/v/scidatetime.svg\" /></a> \n    <a href=\"https://pypistats.org/packages/scidatetime\"><img alt=\"pypi download\" src=\"https://img.shields.io/pypi/dm/scidatetime.svg\" /></a>\n    <a href=\"https://github.com/serfend/scidatetime/releases\"><img alt=\"GitHub release\" src=\"https://img.shields.io/github/release/serfend/scidatetime.svg?style=flat-square\" /></a>\n    <a href=\"https://github.com/serfend/scidatetime/releases\"><img alt=\"GitHub All Releases\" src=\"https://img.shields.io/github/downloads/serfend/scidatetime/total.svg?style=flat-square&color=%2364ff82\" /></a>\n    <a href=\"https://github.com/serfend/scidatetime/commits\"><img alt=\"GitHub last commit\" src=\"https://img.shields.io/github/last-commit/serfend/scidatetime.svg?style=flat-square\" /></a>\n    <a href=\"https://github.com/serfend/scidatetime/actions/workflows/pytest.yml\"><img alt=\"GitHub Workflow Status\" src=\"https://github.com/serfend/scidatetime/actions/workflows/pytest.yml/badge.svg\" /></a>\n</p>\n\n\n\n\n![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white)![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black)![Ubuntu](https://img.shields.io/badge/Ubuntu-E95420?style=for-the-badge&logo=ubuntu&logoColor=white)![Kali](https://img.shields.io/badge/Kali-268BEE?style=for-the-badge&logo=kalilinux&logoColor=white)![FreeBSD](https://img.shields.io/badge/-FreeBSD-%23870000?style=for-the-badge&logo=freebsd&logoColor=white)![Deepin](https://img.shields.io/badge/Deepin-007CFF?style=for-the-badge&logo=deepin&logoColor=white)![Debian](https://img.shields.io/badge/Debian-D70A53?style=for-the-badge&logo=debian&logoColor=white)![Cent OS](https://img.shields.io/badge/cent%20os-002260?style=for-the-badge&logo=centos&logoColor=F0F0F0)\n\n# What?\n\nscidatetime is python module for DateTime handle.\n\n\n\n## Install\n\n```shell\npip install scidatetime\n```\n\n\n\n## Usage\n\n```python\nfrom scidatetime import DateTime\n# \u5f53\u524d\u65f6\u95f4\nprint(DateTime()) # 2023-09-19 14:50:43.570560+08:00\n# \u6307\u5b9a\u65e5\u671f\nprint(DateTime('2023-09-19')) # 2023-09-19 00:00:00+08:00\n# \u6307\u5b9a\u65f6\u95f4\nprint(DateTime('2023-09-19 14:50:43')) # 2023-09-19 14:50:43+08:00\n# \u6307\u5b9a\u65f6\u95f4\u6233\nprint(DateTime(1695106243000)) # 2023-09-19 14:50:43+08:00\n# \u6307\u5b9a\u65f6\u95f4\u53ca\u65f6\u533a\nprint(DateTime('2023-09-19T14:50:43+07:00')) # 2023-09-19 14:50:43+07:00\n\n# \u8ba1\u7b97\u65f6\u95f4\u5dee\nprint((DateTime('2023-09-20') - '2023-09-19').total_seconds()) # 86400.0\nprint((DateTime('2023-09-20') - 60 * 1000)) # 2023-09-19 23:59:00+08:00\n\n# \u83b7\u53d6\u76f8\u5bf9\u65f6\u95f4\nprint(DateTime('2023-09-20').toRelativeTime('2023-09-20 14:23')) # 14\u5c0f\u65f6\u524d\nprint(DateTime('2023-09-20 10:00:00').toRelativeTime('2023-09-20 10:01:00')) # 1\u5206\u949f\u540e\nprint(DateTime('2023-01-20 10:00:00').toRelativeTime()) # xxx\u5e74\u524d\n```\n\n\n\n\n\n## Status\n\n![Alt](https://repobeats.axiom.co/api/embed/05f8549ceb608c78dfa4b74d83d61b0812bf7cd8.svg \"Repobeats analytics image\")\n",
    "bugtrack_url": null,
    "license": "MIT Licence",
    "summary": "scidatetime is python module for DateTime handle.",
    "version": "1.19.20",
    "project_urls": {
        "Homepage": "https://github.com/serfend/scidatetime"
    },
    "split_keywords": [
        "lib",
        "utils"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "46f2b44bf118705fb17fe68ee6bcc94ed7b365c3e8af6bc7dd750428e4d6f78b",
                "md5": "75835c6b16715aac9665db7877d013b2",
                "sha256": "c66cfabeb78c28ce9c3e18bdc4c26324e9de9a7626f1cd80c0116b3e51214670"
            },
            "downloads": -1,
            "filename": "scidatetime-1.19.20-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "75835c6b16715aac9665db7877d013b2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9, <4",
            "size": 85306,
            "upload_time": "2024-02-19T00:00:50",
            "upload_time_iso_8601": "2024-02-19T00:00:50.151127Z",
            "url": "https://files.pythonhosted.org/packages/46/f2/b44bf118705fb17fe68ee6bcc94ed7b365c3e8af6bc7dd750428e4d6f78b/scidatetime-1.19.20-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3c86e407b4cfe5a248c9ac2a2589d560a01bc9ace5b6be212f54ea7d5b3b8e90",
                "md5": "600428e0c46734f14f7116b4e69987a2",
                "sha256": "3481afeaf5eb410908c11ab337bec1b849ef70cc2a22cdc71002aa6a3c58ad85"
            },
            "downloads": -1,
            "filename": "scidatetime-1.19.20.tar.gz",
            "has_sig": false,
            "md5_digest": "600428e0c46734f14f7116b4e69987a2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9, <4",
            "size": 78596,
            "upload_time": "2024-02-19T00:00:51",
            "upload_time_iso_8601": "2024-02-19T00:00:51.885935Z",
            "url": "https://files.pythonhosted.org/packages/3c/86/e407b4cfe5a248c9ac2a2589d560a01bc9ace5b6be212f54ea7d5b3b8e90/scidatetime-1.19.20.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-19 00:00:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "serfend",
    "github_project": "scidatetime",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "scidatetime"
}
        
Elapsed time: 0.19514s