diff --git a/pandas/tseries/tests/test_timeseries.py b/pandas/tseries/tests/test_timeseries.py index 51939ac22e956..a7bd2250f95e3 100644 --- a/pandas/tseries/tests/test_timeseries.py +++ b/pandas/tseries/tests/test_timeseries.py @@ -1420,6 +1420,11 @@ def test_normalize(self): result = rng.normalize() expected = date_range('1/1/2000', periods=10, freq='D') self.assert_(result.equals(expected)) + + rng_ns = pd.DatetimeIndex(np.array([1380585623454345752, 1380585612343234312]).astype("datetime64[ns]")) + rng_ns_normalized = rng_ns.normalize() + expected = pd.DatetimeIndex(np.array([1380585600000000000, 1380585600000000000]).astype("datetime64[ns]")) + self.assert_(rng_ns_normalized.equals(expected)) self.assert_(result.is_normalized) self.assert_(not rng.is_normalized) diff --git a/pandas/tslib.pyx b/pandas/tslib.pyx index 11b86db8b8d92..96391f703d1d7 100644 --- a/pandas/tslib.pyx +++ b/pandas/tslib.pyx @@ -2180,6 +2180,7 @@ cdef inline int64_t _normalized_stamp(pandas_datetimestruct *dts): dts.min = 0 dts.sec = 0 dts.us = 0 + dts.ps = 0 return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts)