File tree 1 file changed +4
-24
lines changed
1 file changed +4
-24
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,6 @@ from pandas._libs.tslibs.util cimport (
63
63
get_c_string_buf_and_size,
64
64
is_array,
65
65
)
66
- from pandas._libs.tslibs.timestamps import Timestamp
67
66
68
67
69
68
cdef extern from " ../src/headers/portable.h" :
@@ -300,7 +299,10 @@ def parse_datetime_string(
300
299
return dt
301
300
302
301
# Handling special case strings today & now
303
- dt = _parse_today_now(date_string)
302
+ if date_string == " now" :
303
+ dt = datetime.now()
304
+ elif date_string == " today" :
305
+ dt = datetime.today()
304
306
if dt is not None :
305
307
return dt
306
308
@@ -1216,25 +1218,3 @@ cpdef str get_rule_month(str source):
1216
1218
return " DEC"
1217
1219
else :
1218
1220
return source.split(" -" )[1 ]
1219
-
1220
- cdef inline object _parse_today_now(str date_string):
1221
- """
1222
- Parse special case date inputs - "today", "now"
1223
- and if present return corresponding datetime object
1224
-
1225
- Parameters
1226
- ----------
1227
- date_string : str
1228
-
1229
- Returns:
1230
- --------
1231
- datetime or None
1232
- """
1233
- cdef:
1234
- object res = None
1235
-
1236
- if date_string == " now" :
1237
- res = Timestamp.utcnow()
1238
- elif date_string == " today" :
1239
- res = Timestamp.today()
1240
- return res
You can’t perform that action at this time.
0 commit comments