pandas.Timestamp.fromisoformat#
- classmethod Timestamp.fromisoformat(date_string)#
Construct a Timestamp from a string in ISO 8601 format.
This classmethod wraps
datetime.datetime.fromisoformat(), returning aTimestampinstead of adatetime.datetime.- Parameters:
- date_stringstr
A date-time string in one of the ISO 8601 formats supported by
datetime.datetime.fromisoformat().
- Returns:
- Timestamp
A Timestamp corresponding to the parsed date-time string.
See also
TimestampRepresents a single timestamp, similar to
datetime.to_datetimeConvert argument to datetime.
datetime.datetime.fromisoformatThe standard library counterpart.
Examples
>>> pd.Timestamp.fromisoformat("2023-01-15") Timestamp('2023-01-15 00:00:00')
>>> pd.Timestamp.fromisoformat("2023-01-15T10:30:00") Timestamp('2023-01-15 10:30:00')