remove legacy datetiem check
@@ -207,27 +207,8 @@ def convert_datetime_array(array):
if not isinstance(array, np.ndarray):
return array
- try:
- dt2001 = np.datetime64('2001')
- legacy_datetime64 = (dt2001.astype('int64') ==
- dt2001.astype('datetime64[ms]').astype('int64'))
- except AttributeError as e:
- if e.args == ("'module' object has no attribute 'datetime64'",):
- # for compatibility with PyPy that doesn't have datetime64
- if 'PyPy' in sys.version:
- legacy_datetime64 = False
- pass
- else:
- raise e
- else:
- raise e
-
# not quite correct, truncates to ms..
if array.dtype.kind == 'M':
- if legacy_datetime64:
- if array.dtype == np.dtype('datetime64[ns]'):
- array = array.astype('int64') / 10**6.0
- else:
array = array.astype('datetime64[us]').astype('int64') / 1000.
elif array.dtype.kind == 'm':
