[issue17486] datetime.timezone returns the wrong tzname()

2013-06-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: This is not a bug in datetime.timezone. The value returned by timezone.tzname() is documented and the code works correctly. %Z should not be used to produce machine-readable timestamps and for a human reader 'UTC+03:00+0300' should not be confusing. N

[issue17486] datetime.timezone returns the wrong tzname()

2013-03-19 Thread Lennart Regebro
New submission from Lennart Regebro: When calling tzname() on a timezone object it will return "UTC" + the offset. >>> from datetime import timezone, timedelta, datetime >>> tz = timezone(timedelta(hours=3)) >>> dt = datetime(2013, 3, 14, 12, 30, tzinfo=tz) >>> dt.tzname() 'UTC+03:00' But this