Share

PyTZ - Python Time Zone Library

Code

Programming Languages: Python

License: Zope Public License, MIT License

Show:

What's happening?

  • Comment: datetime.strftime %s

    Logged In: YES user_id=46639 '%s' is not one of the documented codes supported by Python's strftime implementation. My guess it is being ignored and passed through to some C routine that is expanding it using the processes' localtime. Passing '%s' through when unsupported is probably a Python bug, as according to the docs I think this would need to be spelt '%%s' in order to get a...

    2006-09-21 01:46:11 UTC by zenzen

  • Comment: PYTZ & Py2exe => keyerror

    Logged In: YES user_id=46639 The last release of pytz was made egg friendly - perhaps py2exe has similar restrictions and it will now work?.

    2006-09-21 01:38:07 UTC by zenzen

  • Comment: daylight savings bug in dst() and utcoffset()

    Logged In: YES user_id=46639 Some more discussion on this can be found at http://tinyurl.com/gm7km.

    2006-09-21 01:36:37 UTC by zenzen

  • Comment: Is this an incorrect implementation of datetime.tzinfo?

    Logged In: YES user_id=46639 Yes, the pytz and datetime.tzinfo apis are somewhat different. I tried to make them fully compatible whilst retaining the ability to perform non-ambigous localtime calculations, but this proved to be impossible without making modifications to the core datetime implementation. If you can prove me wrong, I'd welcome a patch.

    2006-09-21 01:35:49 UTC by zenzen

  • Comment: daylight savings bug in dst() and utcoffset()

    Logged In: YES user_id=46639 This is as designed behavior. Please see the pytz README on constructing localized datetimes, in particular the localize and normalize methods.

    2006-09-21 01:26:31 UTC by zenzen

  • Comment: daylight savings bug in dst() and utcoffset()

    Logged In: YES user_id=38329 Here's another example of the same issue. >>> import pytz, datetime >>> zone = pytz.timezone('US/Eastern') >>> # This example is ok, EST is 5 hours behind UTC. >>> print zone.utcoffset(datetime.datetime(2006, 1, 1, tzinfo=pytz.UTC)) -1 day, 19:00:00 >>> print zone.dst(datetime.datetime(2006, 1, 1, tzinfo=pytz.UTC)) 0:00:00 >>> >>> # This example is...

    2006-09-20 16:54:30 UTC by slinkp

  • daylight savings bug in dst() and utcoffset()

    in pytz the daylight savings are not correctly returned by the dst() methods, i looked into the source code and saw that the passed in datetime is ignored imho this should be used to get the utc offset at that given datetime. the same applies to utcoffset() example which fails: import pytz from datetime import datetime import time tz = pytz.timezone('Europe/Vienna') dt =...

    2006-05-05 14:42:13 UTC by bernddorn

  • Comment: PYTZ & Py2exe => keyerror

    Logged In: YES user_id=1491935 I found the same problem using py2exe with pytz in Python 2.4. I havent had time to track this down, but copying the pytz folder and all subfolders to the dist directory works for me. Interestingly, copying the *.pyc files and not the *.py source files does not work. Here is a simple code fragment that I added to the end of my setup.py that does the...

    2006-04-01 17:39:10 UTC by cohenaa

  • Comment: PYTZ & Py2exe => keyerror

    Logged In: YES user_id=865368 ok I copied pytz folder to dist/ and it works he proposes zoneinfo folder but that did not work for me.

    2005-10-28 20:37:27 UTC by nkour

  • Comment: PYTZ & Py2exe => keyerror

    Logged In: YES user_id=865368 I have the same problem, the workaround proposed did not solve it. Any help?.

    2005-10-28 20:27:03 UTC by nkour