DateTime filter return a wrong result

I have the followinf DataFrame “df”:

DateTime
2019-03-07 23:00:00
2019-03-07 23:10:00
2019-03-08 23:10:00
2019-03-09 23:10:00
2019-03-10 23:10:00
2019-03-11 23:10:00
2019-03-12 23:10:00

df.dtypes:
DateTime              datetime64[ns]

I need to return rows before “2019-03-11”. This is my current code:

value_to_check = pd.Timestamp(2019, 3, 11)
df["DateTime"] = pd.to_datetime(df["DateTime"])

df[df["DateTime"]<value_to_check]
# OR
df.query('DateTime < "2019-03-11 00:00:00"').tail()

For some reason it returns a wrong result (missing “2019-03-10 23:10:00”):

2019-03-07 23:00:00
2019-03-07 23:10:00
2019-03-08 23:10:00
2019-03-09 23:10:00

But surprisingly it works well if I change the day limit to any number lower than 10, e.g “2019-03-08 00:00:00”.

Answer

I run this code and output is correct:

df = pd.DataFrame({
    'DateTime': ["2019-03-07 23:00:00", 
                 "2019-03-07 23:10:00",
                 "2019-03-08 23:10:00",
                 "2019-03-09 23:10:00",
                 "2019-03-10 23:10:00",
                 "2019-03-11 23:10:00",
                 "2019-03-12 23:10:00"
                ]
})
df["DateTime"] = pd.to_datetime(df["DateTime"])
print(df["DateTime"])

value_to_check = pd.Timestamp(2019, 3, 11)
df[df["DateTime"]<value_to_check]

Output:

0   2019-03-07 23:00:00
1   2019-03-07 23:10:00
2   2019-03-08 23:10:00
3   2019-03-09 23:10:00
4   2019-03-10 23:10:00
5   2019-03-11 23:10:00
6   2019-03-12 23:10:00
Name: DateTime, dtype: datetime64[ns]

    DateTime
0   2019-03-07 23:00:00
1   2019-03-07 23:10:00
2   2019-03-08 23:10:00
3   2019-03-09 23:10:00
4   2019-03-10 23:10:00