{ "info": { "author": "Vincent Driessen", "author_email": "vincent@3rdcloud.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Environment :: MacOS X", "Environment :: No Input/Output (Daemon)", "Environment :: Other Environment", "Environment :: Plugins", "Environment :: Web Environment", "Environment :: Win32 (MS Windows)", "Framework :: Buildout", "Framework :: CherryPy", "Framework :: Django", "Framework :: Plone", "Framework :: Pylons", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: End Users/Desktop", "Intended Audience :: Financial and Insurance Industry", "Intended Audience :: Healthcare Industry", "Intended Audience :: Information Technology", "Intended Audience :: Legal Industry", "Intended Audience :: Manufacturing", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Internet", "Topic :: Internet :: WWW/HTTP", "Topic :: Office/Business", "Topic :: Scientific/Engineering", "Topic :: Software Development", "Topic :: System", "Topic :: Terminals", "Topic :: Utilities" ], "description": "**NOTE:** \nThis library will not be maintained any further. **You probably want to use\nthe excellent [Arrow](http://crsmithdev.com/arrow/) library.**\n\n\n> \u201cThere should be one\u2014and preferably only one\u2014obvious way to do it.\u201d\n\nIn fact, version 0.7 of times has been rewritten to be implemented on top of\nArrow, so it still provides the Times interface, but you'll already be using\nArrow. You can probably easily replace your times function calls by Arrow\nobjects.\n\n---\n\nTimes\n=====\n\nBuild status:\n[![Build Status](https://travis-ci.org/nvie/times.svg?branch=master)](http://travis-ci.org/nvie/times)\n[![Coverage Status](https://img.shields.io/coveralls/nvie/times.svg)](https://coveralls.io/r/nvie/times?branch=master)\n\n\nTimes is a small, minimalistic, Python library for dealing with time\nconversions to and from timezones, for once and for all.\n\n\nAccepting time\n--------------\n\nNever work with _local_ times. Whenever you must accept local time input (e.g.\nfrom a user), convert it to universal time immediately:\n\n```pycon\n>>> times.to_universal(local_time, 'Europe/Amsterdam')\ndatetime.datetime(2012, 2, 1, 10, 31, 45, 781262)\n```\n\nThe second argument can be a `pytz.timezone` instance, or a timezone string.\n\nIf the `local_time` variable already holds timezone info, you _must_ leave out\nthe source timezone from the call.\n\nTo enforce best practices, `times` will never implicitly convert times for you,\neven if that would technically be possible.\n\n\nDate Strings\n------------\nIf you want to accepting datetime representations in string form (for example,\nfrom JSON APIs), you can convert them to universal datetimes easily:\n\n```pycon\n>>> import time, times\n>>> print times.to_universal('2012-02-03 11:59:03-0500') # auto-detects source timezone\n```\n\n`Times` utilizes the string parsing routines available in [dateutil][1]. Note\nthat the source timezone is auto-detected from the string. If the string\ncontains a timezone offset, you are not allowed to explicitly specify one.\n\nIf the string does not contain any timezone offset, you _must_ specify the\nsource timezone explicitly:\n\n```pycon\n>>> print times.to_universal('2012-02-03 11:59:03', 'Europe/Amsterdam')\n```\n\nThis is the inverse of `times.format()`.\n\n\nPOSIX timestamps\n----------------\nIf you prefer working with UNIX (POSIX) timestamps, you can convert them to\nsafe datetime representations easily:\n\n```pycon\n>>> import time, times\n>>> print times.to_universal(time.time())\n2012-02-03 11:59:03.588419\n```\n\nNote that `to_universal` auto-detects that you give it a UNIX timestamp.\n\nTo get the UNIX timestamp representation of a universal datetime, use:\n\n```pycon\n>>> print times.to_unix(universal_time)\n```\n\n\nCurrent time\n------------\n\nWhen you want to record the current time, you can use this convenience method:\n\n```pycon\n>>> import times\n>>> print times.now()\ndatetime.datetime(2012, 2, 1, 11, 51, 27, 621491)\n```\n\n\nPresenting times\n----------------\n\nTo _present_ times to the end user of your software, you should explicitly\nformat your universal time to your user's local timezone.\n\n```pycon\n>>> import times\n>>> now = times.now()\n>>> print times.format(now, 'CET')\n2012-02-01 21:32:10+0100\n```\n\nAs with the `to_universal` function, the second argument may be either\na timezone instance or a timezone string.\n\n**Note**: It _is_ possible to convert universal times to local times, using\n`to_local`). However, you probably shouldn't do it, unless you want to\n`strftime()` the resulting local date multiple times. In any other case, you\nare advised to use `times.format()` directly instead.\n\n[1]: http://labix.org/python-dateutil#head-c0e81a473b647dfa787dc11e8c69557ec2c3ecd2\n", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nvie/times/", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "times", "package_url": "https://pypi.org/project/times/", "platform": "any", "project_url": "https://pypi.org/project/times/", "project_urls": { "Homepage": "https://github.com/nvie/times/" }, "release_url": "https://pypi.org/project/times/0.7/", "requires_dist": [ "arrow" ], "requires_python": null, "summary": "Times is a small, minimalistic, Python library for dealing with time conversions between universal time and arbitrary timezones.", "version": "0.7" }, "last_serial": 1200147, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "e475f37292b08a39574c1f0bcc87168b", "sha256": "edd56e14941af417dfbebc95517bf8a7f9e5053768df2d8da8391faa534671c4" }, "downloads": -1, "filename": "times-0.2.tar.gz", "has_sig": false, "md5_digest": "e475f37292b08a39574c1f0bcc87168b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2429, "upload_time": "2012-02-02T10:50:07", "url": "https://files.pythonhosted.org/packages/fc/84/ee061d3087dc0cfbae2efb298794c6ed37d15ece6396135774beadead71f/times-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "86024027e9676008bb36a3cc91bddd3e", "sha256": "84ffb24432619842bc0af58c2775b3ab5a18f2d5c7dc5f10ef3351f446b7285f" }, "downloads": -1, "filename": "times-0.3.tar.gz", "has_sig": false, "md5_digest": "86024027e9676008bb36a3cc91bddd3e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2704, "upload_time": "2012-02-04T11:08:04", "url": "https://files.pythonhosted.org/packages/40/03/5bf96d85e508b8ab0072b58afd99974625bcdff2fc771ff61a959d60a389/times-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "f14e779978aff4623fd297c0a9062c77", "sha256": "9c8ce1c0a13a2da1d0939a8c56e9762b78ac15b8c2e3fb444a49d9389108dda9" }, "downloads": -1, "filename": "times-0.4.tar.gz", "has_sig": false, "md5_digest": "f14e779978aff4623fd297c0a9062c77", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2827, "upload_time": "2012-02-08T00:36:08", "url": "https://files.pythonhosted.org/packages/eb/b5/326abc22838391d1222aba73676777d6f5b7f62c96996617b604a0dbe80a/times-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "6666fe2ffcf51d349be0401d8444b9e9", "sha256": "c18489127d6e8a77849f1abd99113ce10836f8e0e5348018f8660408f7782c05" }, "downloads": -1, "filename": "times-0.5.tar.gz", "has_sig": false, "md5_digest": "6666fe2ffcf51d349be0401d8444b9e9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2747, "upload_time": "2012-08-04T09:03:45", "url": "https://files.pythonhosted.org/packages/f6/b9/2ad676d8e84df704502a34b3cfdc382ab66450ccbd12ebb77782ba03b7bf/times-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "b3242306192fb30df2212e306b60a1a7", "sha256": "233e9213cbc15b270a2675aec728e7ef7f6f6680fc0cd1f58609ea437335984f" }, "downloads": -1, "filename": "times-0.6.tar.gz", "has_sig": false, "md5_digest": "b3242306192fb30df2212e306b60a1a7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4499, "upload_time": "2012-10-15T21:10:57", "url": "https://files.pythonhosted.org/packages/fe/ac/3cc9896c25feb669cb38d94b711d1dd69a87fe6a6421ad63dc13f4ac6dff/times-0.6.tar.gz" } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "92d842572bc31bff74c24f1b45e03132", "sha256": "e0d4e036d02e802dbaece63a5074802cfdb4ded5ff5dd7c4db9aded26a6976d2" }, "downloads": -1, "filename": "times-0.6.1.tar.gz", "has_sig": false, "md5_digest": "92d842572bc31bff74c24f1b45e03132", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4510, "upload_time": "2013-02-11T08:47:42", "url": "https://files.pythonhosted.org/packages/74/1a/ea96e09bd42d65b0963db4ce8f2adc32ce6247472536a8f72e962bb3cb74/times-0.6.1.tar.gz" } ], "0.6.2": [ { "comment_text": "", "digests": { "md5": "4bf1d4dda17e4fe2ec08d6c677156959", "sha256": "ed8a7ac5e0fdc91c0a1fb22998f82c0b3d7703858f382fd4317c3e21dadca42a" }, "downloads": -1, "filename": "times-0.6.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4bf1d4dda17e4fe2ec08d6c677156959", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4050, "upload_time": "2013-12-28T21:39:00", "url": "https://files.pythonhosted.org/packages/a5/fa/743c49100d4f6fdd5908a012289eaf3fed9453a5a443eb1d6c0a04c40ad5/times-0.6.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "26f3d2c0c4c2a7075205cc5ff37ed434", "sha256": "e464bfc43f0ef43314797526f9b68def3edb79ceb21b405a1068f01fd306929a" }, "downloads": -1, "filename": "times-0.6.2.tar.gz", "has_sig": false, "md5_digest": "26f3d2c0c4c2a7075205cc5ff37ed434", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4519, "upload_time": "2013-07-29T09:53:23", "url": "https://files.pythonhosted.org/packages/d5/c0/95b7bc3d2badad37bff8e7d72921b76b3008ccfbd66ba69e7b162e42276c/times-0.6.2.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "3cf873b5c622b74db3a6317629085481", "sha256": "71a47e488fb727fecbd2bc6b4e3559fd4425eb6e20c68b1418069325a4c58a37" }, "downloads": -1, "filename": "times-0.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3cf873b5c622b74db3a6317629085481", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3826, "upload_time": "2014-08-24T06:13:21", "url": "https://files.pythonhosted.org/packages/5d/2f/811d8183abae998effbbb1a191af2469a6c18bfcb4d3edfd4fe9c096c5f8/times-0.7-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "99acd36723f6d770b0f853d1cf8c96ac", "sha256": "ed9da7bd0384ff4e1b3fc84114c27c2e3987072dbaf24425340bfedd405bc4b5" }, "downloads": -1, "filename": "times-0.7.tar.gz", "has_sig": false, "md5_digest": "99acd36723f6d770b0f853d1cf8c96ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4228, "upload_time": "2014-08-24T06:13:25", "url": "https://files.pythonhosted.org/packages/41/be/ec94886bf2540dca5c120950b290f6b4aa42c35476d4a82aefb19de0ebe9/times-0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3cf873b5c622b74db3a6317629085481", "sha256": "71a47e488fb727fecbd2bc6b4e3559fd4425eb6e20c68b1418069325a4c58a37" }, "downloads": -1, "filename": "times-0.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3cf873b5c622b74db3a6317629085481", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3826, "upload_time": "2014-08-24T06:13:21", "url": "https://files.pythonhosted.org/packages/5d/2f/811d8183abae998effbbb1a191af2469a6c18bfcb4d3edfd4fe9c096c5f8/times-0.7-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "99acd36723f6d770b0f853d1cf8c96ac", "sha256": "ed9da7bd0384ff4e1b3fc84114c27c2e3987072dbaf24425340bfedd405bc4b5" }, "downloads": -1, "filename": "times-0.7.tar.gz", "has_sig": false, "md5_digest": "99acd36723f6d770b0f853d1cf8c96ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4228, "upload_time": "2014-08-24T06:13:25", "url": "https://files.pythonhosted.org/packages/41/be/ec94886bf2540dca5c120950b290f6b4aa42c35476d4a82aefb19de0ebe9/times-0.7.tar.gz" } ] }