pandas.Timestamp.fromordinal

classmethod Timestamp.fromordinal(ordinal, freq=None, tz=None)

Passed an ordinal, translate and convert to a ts. Note: by definition there cannot be any tz info on the ordinal itself.

Parameters
ordinal:int

Date corresponding to a proleptic Gregorian ordinal.

freq:str, DateOffset

Offset to apply to the Timestamp.

tz:str, pytz.timezone, dateutil.tz.tzfile or None

Time zone for the Timestamp.

Examples

>>> pd.Timestamp.fromordinal(737425)
Timestamp('2020-01-01 00:00:00')

© 2008–2021, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/1.3.4/reference/api/pandas.Timestamp.fromordinal.html