pandas.Timestamp.now#

classmethodTimestamp.now(tz=None)#

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. Otherwise, it returns the current local time.

Parameters:
tzstr or timezone object, default None

Timezone to localize to.

See also

to_datetime

Convert argument to datetime.

Timestamp.utcnow

Return a new Timestamp representing UTC day and time.

Timestamp.today

Return the current time in the local timezone.

Examples

>>> pd.Timestamp.now()
Timestamp('2020年11月16日 22:06:16.378782')

Analogous for pd.NaT:

>>> pd.NaT.now()
NaT
On this page

This Page