How to create pandas 'now' Timestamp

In order to create a pandas Timestamp representing the current point in time, use

example.py
pd.Timestamp('now')

This will create a Timestamp in the current timezone.

Full example:

example.py
import pandas as pd

now = pd.Timestamp('now')

print(now) # Prints e.g. Timestamp('2020-05-25 19:02:31.051836')

 


Check out similar posts by category: Pandas, Python