Wrong interpretation of time strings
Closed this issue · 3 comments
kjeel-dev commented
fromtime = "2023-01-31 12:01"
totime = "2023-02-10 12:00"
df = c.read(tags, fromtime, totime, 60)
tagreader 3.0.1 with pandas 1.5.0 reads the above correctly. After an update to tagreader 3.0.2 and pandas 2.0.1 it does not. totime is then interpreted as October 2, not February 10.
utils.py issues the following warning:
UserWarning: Parsing dates in %Y-%m-%d %H:%M format when dayfirst=True was specified. Pass dayfirst=False
or specify a format to silence this warning.
date_stamp = pd.to_datetime(date_stamp, dayfirst=True)
mortendaehli commented
in the meantime could you check if the following works?
from datetime import datetime
import pandas as pd
fromtime = pd.to_datetime(datetime(2023, 1, 31, 12, 1, 0))
totime = pd.to_datetime(datetime(2023, 2, 10, 12, 0, 0))
df = c.read(tags, fromtime, totime, 60)
mortendaehli commented
Closed in #177