pandas.Timestamp.date#
- Timestamp.date()#
Returns datetime.date with the same year, month, and day.
This method extracts the date component from the Timestamp and returns it as a datetime.date object, discarding the time information.
- Returns:
- datetime.date
The date part of the Timestamp.
See also
Timestamp
Represents a single timestamp, similar to datetime.
datetime.datetime.date
Extract the date component from a datetime object.
Examples
Extract the date from a Timestamp:
>>> ts = pd.Timestamp('2023-01-01 10:00:00.00') >>> ts Timestamp('2023-01-01 10:00:00') >>> ts.date() datetime.date(2023, 1, 1)