Skip to content

Commit 673ff45

Browse files
committed
to_datetime error correction
1 parent 4fe2f31 commit 673ff45

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pandas/_libs/tslibs/parsing.pyx

+6-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,12 @@ def parse_datetime_string(
282282
pass
283283

284284
try:
285-
dt = du_parse(date_string, default=_DEFAULT_DATETIME,
285+
if date_string == 'today':
286+
dt = datetime.today()
287+
elif date_string == 'now':
288+
dt = datetime.now()
289+
else:
290+
dt = du_parse(date_string, default=_DEFAULT_DATETIME,
286291
dayfirst=dayfirst, yearfirst=yearfirst, **kwargs)
287292
except TypeError:
288293
# following may be raised from dateutil

0 commit comments

Comments
 (0)