La date peut valoir None dans localized_datetime
This commit is contained in:
parent
8213b919ee
commit
af251f267b
1 changed files with 5 additions and 4 deletions
|
@ -350,10 +350,11 @@ def localized_datetime(date=None, tz=None):
|
|||
%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:]
|
||||
if date is not 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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue