convert date to datetime if necessary
This commit is contained in:
parent
5abbc339e9
commit
57cade3cf3
1 changed files with 2 additions and 0 deletions
|
@ -76,6 +76,8 @@ def toLocalTime(d):
|
||||||
return d
|
return d
|
||||||
cet = pytz.timezone('CET')
|
cet = pytz.timezone('CET')
|
||||||
try:
|
try:
|
||||||
|
if not isinstance(d, datetime):
|
||||||
|
d = datetime(d.year, d.month, d.day)
|
||||||
return d.astimezone(cet)
|
return d.astimezone(cet)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
return d
|
return d
|
||||||
|
|
Loading…
Add table
Reference in a new issue