times
Advanced tools
+1
-1
| Metadata-Version: 1.0 | ||
| Name: times | ||
| Version: 0.4 | ||
| Version: 0.5 | ||
| Summary: Times is a small, minimalistic, Python library for dealing with time conversions between universal time and arbitrary timezones. | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/nvie/times/ |
+2
-8
@@ -5,2 +5,3 @@ import sys | ||
| def get_version(): | ||
@@ -14,9 +15,2 @@ basedir = os.path.dirname(__file__) | ||
| def get_dependencies(): | ||
| deps = ['pytz'] | ||
| if sys.version_info[0] == 3: # Python >= 3 | ||
| deps.append('python-dateutil >= 2') | ||
| else: | ||
| deps.append('python-dateutil < 2') | ||
| return deps | ||
@@ -38,3 +32,3 @@ setup( | ||
| platforms='any', | ||
| install_requires=get_dependencies(), | ||
| install_requires=['pytz', 'python-dateutil >= 2.1'], | ||
| classifiers=[ | ||
@@ -41,0 +35,0 @@ # As from http://pypi.python.org/pypi?%3Aaction=list_classifiers |
| Metadata-Version: 1.0 | ||
| Name: times | ||
| Version: 0.4 | ||
| Version: 0.5 | ||
| Summary: Times is a small, minimalistic, Python library for dealing with time conversions between universal time and arbitrary timezones. | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/nvie/times/ |
| pytz | ||
| python-dateutil < 2 | ||
| python-dateutil >= 2.1 |
@@ -10,3 +10,2 @@ import datetime | ||
| _default_fmt = '%Y-%m-%d %H:%M:%S%z' | ||
@@ -90,10 +89,11 @@ def to_universal(local_dt, timezone=None): | ||
| """Formats the given universal time for display in the given time zone.""" | ||
| if fmt is None: | ||
| fmt = _default_fmt | ||
| if timezone is None: | ||
| raise ValueError('Please give an explicit timezone.') | ||
| return to_local(dt, timezone).strftime(fmt) | ||
| local = to_local(dt, timezone) | ||
| if fmt is None: | ||
| return local.isoformat() | ||
| else: | ||
| return local.strftime(fmt) | ||
| now = datetime.datetime.utcnow |
+1
-1
@@ -1,1 +0,1 @@ | ||
| VERSION = '0.4' | ||
| VERSION = '0.5' |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
9314
-1.95%147
-3.92%