diff --git a/pandas/_libs/tslibs/nattype.pyx b/pandas/_libs/tslibs/nattype.pyx index 49c1c46ea4935..8bd150792419b 100644 --- a/pandas/_libs/tslibs/nattype.pyx +++ b/pandas/_libs/tslibs/nattype.pyx @@ -1260,7 +1260,9 @@ class NaTType(_NaT): Return new Timestamp object representing current time local to tz. This method returns a new `Timestamp` object that represents the current time. - If a timezone is provided, the current time will be localized to that timezone. + If a timezone is provided, either through a timezone object or an IANA + standard timezone identifier, the current time will be localized to that + timezone. Otherwise, it returns the current local time. Parameters @@ -1279,6 +1281,11 @@ class NaTType(_NaT): >>> pd.Timestamp.now() # doctest: +SKIP Timestamp('2020-11-16 22:06:16.378782') + If you want a specific timezone, in this case 'Brazil/East': + + >>> pd.Timestamp.now('Brazil/East') + Timestamp('2025-11-11 22:17:59.609943-03:00) + Analogous for ``pd.NaT``: >>> pd.NaT.now() diff --git a/pandas/_libs/tslibs/timestamps.pyx b/pandas/_libs/tslibs/timestamps.pyx index afbefd9b84461..2dff239642663 100644 --- a/pandas/_libs/tslibs/timestamps.pyx +++ b/pandas/_libs/tslibs/timestamps.pyx @@ -1917,7 +1917,9 @@ class Timestamp(_Timestamp): Return new Timestamp object representing current time local to tz. This method returns a new `Timestamp` object that represents the current time. - If a timezone is provided, the current time will be localized to that timezone. + If a timezone is provided, either through a timezone object or an IANA + standard timezone identifier, the current time will be localized to that + timezone. Otherwise, it returns the current local time. Parameters @@ -1936,6 +1938,11 @@ class Timestamp(_Timestamp): >>> pd.Timestamp.now() # doctest: +SKIP Timestamp('2020-11-16 22:06:16.378782') + If you want a specific timezone, in this case 'Brazil/East': + + >>> pd.Timestamp.now('Brazil/East') + Timestamp('2025-11-11 22:17:59.609943-03:00) + Analogous for ``pd.NaT``: >>> pd.NaT.now()