diff --git a/ci/code_checks.sh b/ci/code_checks.sh index f2d9f582d8932..029f9a9467fda 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -106,8 +106,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Timedelta.resolution PR02" \ -i "pandas.Timedelta.to_timedelta64 SA01" \ -i "pandas.TimedeltaIndex.to_pytimedelta RT03,SA01" \ - -i "pandas.Timestamp.max PR02" \ - -i "pandas.Timestamp.min PR02" \ -i "pandas.Timestamp.nanosecond GL08" \ -i "pandas.Timestamp.resolution PR02" \ -i "pandas.Timestamp.tzinfo GL08" \ diff --git a/pandas/_libs/tslibs/timestamps.pyx b/pandas/_libs/tslibs/timestamps.pyx index 34c84d396ad64..50b7ef791445c 100644 --- a/pandas/_libs/tslibs/timestamps.pyx +++ b/pandas/_libs/tslibs/timestamps.pyx @@ -633,6 +633,52 @@ cdef class _Timestamp(ABCTimestamp): field, freq_name, month_kw, self._creso) return out[0] + def max(self) -> "Timestamp": + """ + A constant that represents the maximum valid date and time value. + + This property returns the highest datetime value that can be represented + by a pandas.Timestamp object, which is equivalent to + pd.Timestamp('2262-04-11 23:47:16.854775807'). + + Returns + ------- + Timestamp + The maximum valid datetime value for a Timestamp object. + + See Also + -------- + Timestamp.min : Return the minimum valid date and time value for Timestamp. + + Examples + -------- + >>> pd.Timestamp.max + Timestamp('2262-04-11 23:47:16.854775807') + """ + + def min(self) -> "Timestamp": + """ + Return the minimum representable Timestamp. + + This property returns the earliest datetime value that can be represented + by a pandas.Timestamp object, which is equivalent to + pd.Timestamp('1677-09-21 00:12:43.145224193'). + + Returns + ------- + Timestamp + The earliest representable Timestamp. + + See Also + -------- + Timestamp.max : Return the maximum representable Timestamp. + + Examples + -------- + >>> pd.Timestamp.min + Timestamp('1677-09-21 00:12:43.145224193') + """ + @property def is_month_start(self) -> bool: """