Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pandas/_libs/tslibs/nattype.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1072,8 +1072,13 @@ class NaTType(_NaT):

Examples
--------
>>> pd.Timestamp.utcnow() # doctest: +SKIP
Timestamp('2020-11-16 22:50:18.092888+0000', tz='UTC')
>>> 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') # doctest: +SKIP
Timestamp('2025-11-11 22:17:59.609943-03:00)
""",
)

Expand Down
9 changes: 8 additions & 1 deletion pandas/_libs/tslibs/timestamps.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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') # doctest: +SKIP
Timestamp('2025-11-11 22:17:59.609943-03:00)

Analogous for ``pd.NaT``:

>>> pd.NaT.now()
Expand Down
Loading