mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-05 03:00:15 -04:00
to_datetime: only convert datetime.date objects.
When d is of type datetime.datetime isinstance(d, datetime.date) returns True.
This commit is contained in:
@@ -1052,7 +1052,7 @@ def to_date(d):
|
||||
return d
|
||||
|
||||
def to_datetime(d):
|
||||
if isinstance(d, date):
|
||||
if type(d) == date:
|
||||
return datetime(d.year, d.month, d.day)
|
||||
return d
|
||||
|
||||
|
||||
Reference in New Issue
Block a user