{ "info": { "author": "fanwei.zeng", "author_email": "stayblank@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# TimeKong\n\n![time kong](https://github.com/PurpleSun/time_kong/blob/master/time-kong-logo.png?raw=true \"time kong\")\n\nTime converter between timestamp, string and datetime.\n\n\n## Installation\n\nYou can install `time-kong` simply with `pip`:\n\n```\npip install time-kong\n```\n\n\n## Usages\n\n### TimeKong\n\nConvert time between timestamp, string and datetime:\n\n```python\nfrom datetime import datetime\n\nfrom time_kong import TimeKong\n\nts = 1558883766.864879\nTimeKong.timestamp2string(ts, formatter=\"%Y-%m-%d %H:%M:%S.%f\")\n# '2019-05-26 23:16:06.864879'\nTimeKong.timestamp2datetime(ts)\n# datetime.datetime(2019, 5, 26, 23, 16, 6, 864879)\n\nds = '2019-05-26 23:16:06.864879'\nTimeKong.string2timestamp(ds, formatter=\"%Y-%m-%d %H:%M:%S.%f\")\n# 1558883766.864879\nTimeKong.string2datetime(ds, formatter=\"%Y-%m-%d %H:%M:%S.%f\")\n# datetime.datetime(2019, 5, 26, 23, 16, 6, 864879)\n\ndt = datetime(year=2019, month=5, day=26, hour=22, minute=42, second=26, microsecond=864879)\nTimeKong.datetime2timestamp(dt)\n# 1558881746.864879\nTimeKong.datetime2string(dt, formatter=\"%Y-%m-%d %H:%M:%S.%f\")\n# '2019-05-26 22:42:26.864879'\n```\n\nConstants included:\n\n1. `TimeKong.NANOSECOND`\n1. `TimeKong.MICROSECOND`\n2. `TimeKong.MILLISECOND`\n3. `TimeKong.SECOND`\n4. `TimeKong.MINUTE`\n5. `TimeKong.HOUR`\n6. `TimeKong.DAY`\n7. `TimeKong.WEEK`\n8. `TimeKong.MONTH`\n9. `TimeKong.YEAR`\n\n\n## Author\n\ntime-kong is developed and maintained by fanwei.zeng (stayblank@gmail.com). It can be found here:\n\nhttps://github.com/PurpleSun/time_kong", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/PurpleSun/time_kong", "keywords": "time,transform,converter,adaptor", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "time-kong", "package_url": "https://pypi.org/project/time-kong/", "platform": "any", "project_url": "https://pypi.org/project/time-kong/", "project_urls": { "Homepage": "https://github.com/PurpleSun/time_kong" }, "release_url": "https://pypi.org/project/time-kong/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "A useful time transform util, transforms between string, timestamp and datetime format", "version": "0.0.3" }, "last_serial": 5332095, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "33213e3b9304cf664e6be8534c809eaf", "sha256": "e529e03236fd88aec2264b06f11295673dcbe9649ae04b4f6a963ac005496037" }, "downloads": -1, "filename": "time-kong-0.0.1.tar.gz", "has_sig": false, "md5_digest": "33213e3b9304cf664e6be8534c809eaf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2078, "upload_time": "2019-05-26T16:31:20", "url": "https://files.pythonhosted.org/packages/df/f7/5567a874b4236a7874c42b0d3dfa23216271b8375cceff7991ba6f46bd97/time-kong-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "87bc9b91783375c9136d3b7050cf12d9", "sha256": "7f6a8368787a04f8adf83a45b7e2fd8531cc906a5af0d2fa4d2faf44c09de3bb" }, "downloads": -1, "filename": "time-kong-0.0.2.tar.gz", "has_sig": false, "md5_digest": "87bc9b91783375c9136d3b7050cf12d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2938, "upload_time": "2019-05-26T16:34:46", "url": "https://files.pythonhosted.org/packages/af/10/bdf42b276527e02fbc8a4b3baa376a8b9026d0717a3c2c6ed7e080731e8d/time-kong-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "78aabfcb29f700e71a7b83eb4833a89a", "sha256": "49bc435ab01a6a941e3ab0e6af74c1319f90036ec16c1f3eb588d55ecaa92009" }, "downloads": -1, "filename": "time-kong-0.0.3.tar.gz", "has_sig": false, "md5_digest": "78aabfcb29f700e71a7b83eb4833a89a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2620, "upload_time": "2019-05-29T12:34:31", "url": "https://files.pythonhosted.org/packages/30/c4/5f2d2ec6b1757afb4cbb00ec110718c0c4fc0851a636dbff3ef3e0e2e9f4/time-kong-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "78aabfcb29f700e71a7b83eb4833a89a", "sha256": "49bc435ab01a6a941e3ab0e6af74c1319f90036ec16c1f3eb588d55ecaa92009" }, "downloads": -1, "filename": "time-kong-0.0.3.tar.gz", "has_sig": false, "md5_digest": "78aabfcb29f700e71a7b83eb4833a89a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2620, "upload_time": "2019-05-29T12:34:31", "url": "https://files.pythonhosted.org/packages/30/c4/5f2d2ec6b1757afb4cbb00ec110718c0c4fc0851a636dbff3ef3e0e2e9f4/time-kong-0.0.3.tar.gz" } ] }