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,6 +350,7 @@ def localized_datetime(date=None, tz=None):
|
||||||
%Y%m%d%H%M%S, and a tz timezone looking like +0200"""
|
%Y%m%d%H%M%S, and a tz timezone looking like +0200"""
|
||||||
|
|
||||||
if tz is None:
|
if tz is None:
|
||||||
|
if date is not None:
|
||||||
if "+" in date or '-' in date or 'Z' in date:
|
if "+" in date or '-' in date or 'Z' in date:
|
||||||
if date.endswith("Z"):
|
if date.endswith("Z"):
|
||||||
date = date[:-1] + "+0000"
|
date = date[:-1] + "+0000"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue