scidatetime


Namescidatetime JSON
Version 1.20.5 PyPI version JSON
download
home_pagehttps://github.com/serfend/scidatetime
Summaryscidatetime is python module for DateTime handle.
upload_time2024-08-28 06:07:56
maintainerNone
docs_urlNone
authorserfend
requires_python<4,>=3.9
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": null,
    "docs_url": null,
    "requires_python": "<4,>=3.9",
    "maintainer_email": null,
    "keywords": "lib, utils",
    "author": "serfend",
    "author_email": "serfend@foxmail.com",
    "download_url": "https://files.pythonhosted.org/packages/72/74/d1a1c76e7d4d1f319f47bc4970e45389568d3db668b2c55498e15ec3f3f1/scidatetime-1.20.5.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.20.5",
    "project_urls": {
        "Homepage": "https://github.com/serfend/scidatetime"
    },
    "split_keywords": [
        "lib",
        " utils"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "601a0a22b5e77c493f6cc82724dd5cf34cc447797a8fab3c9f03c647e9d03fcc",
                "md5": "bfb981b1e4f2c83e18b593e1112f47b3",
                "sha256": "62fa71c067bc97a25c4d446fa8a3f34dcbe8f6137f8301e06638ca94818085a9"
            },
            "downloads": -1,
            "filename": "scidatetime-1.20.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bfb981b1e4f2c83e18b593e1112f47b3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.9",
            "size": 85981,
            "upload_time": "2024-08-28T06:07:55",
            "upload_time_iso_8601": "2024-08-28T06:07:55.154355Z",
            "url": "https://files.pythonhosted.org/packages/60/1a/0a22b5e77c493f6cc82724dd5cf34cc447797a8fab3c9f03c647e9d03fcc/scidatetime-1.20.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7274d1a1c76e7d4d1f319f47bc4970e45389568d3db668b2c55498e15ec3f3f1",
                "md5": "97fc47653811256c24290740d8273708",
                "sha256": "47e2cda9399e6d8b683b0b3c630870c523017d7bd6af7d557fe06d7856699e4e"
            },
            "downloads": -1,
            "filename": "scidatetime-1.20.5.tar.gz",
            "has_sig": false,
            "md5_digest": "97fc47653811256c24290740d8273708",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.9",
            "size": 78983,
            "upload_time": "2024-08-28T06:07:56",
            "upload_time_iso_8601": "2024-08-28T06:07:56.713524Z",
            "url": "https://files.pythonhosted.org/packages/72/74/d1a1c76e7d4d1f319f47bc4970e45389568d3db668b2c55498e15ec3f3f1/scidatetime-1.20.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-28 06:07:56",
    "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.79769s