Skip to content

REF change to_datetime -> Timestamp for in odf reader #49712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pandas/io/excel/_odfreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ def _get_cell_value(self, cell) -> Scalar | NaTType:
return float(cell_value)
elif cell_type == "date":
cell_value = cell.attributes.get((OFFICENS, "date-value"))
return pd.to_datetime(cell_value)
return pd.Timestamp(cell_value)
elif cell_type == "time":
stamp = pd.to_datetime(str(cell))
stamp = pd.Timestamp(str(cell))
# cast needed here because Scalar doesn't include datetime.time
return cast(Scalar, stamp.time())
else:
Expand Down