Enlève __unicode__ sur generalizedTimeFormat

This commit is contained in:
Pierre-Elliott Bécue 2015-09-26 02:50:09 +02:00
parent 9610cc6b0b
commit c18de85fd2
3 changed files with 15 additions and 6 deletions

View file

@ -349,6 +349,12 @@ def localized_datetime(date=None, tz=None):
"""Builds a datetime object based on a date string formatted as
%Y%m%d%H%M%S, and a tz timezone looking like +0200"""
if tz is None:
if "+" in date or '-' in date or 'Z' in date:
if date.endswith("Z"):
date = date[:-1] + "+0000"
date, tz = date[:-5], date[-5:]
_notz = (tz is None)
# Shit may happen