pandas.Period.now — pandas 3.0.0.dev0+2103.g41968a550a documentation (original) (raw)

classmethod Period.now(freq)#

Return the period of now’s date.

The now method provides a convenient way to generate a period object for the current date and time. This can be particularly useful in financial and economic analysis, where data is often collected and analyzed in regular intervals (e.g., hourly, daily, monthly). By specifying the frequency, users can create periods that match the granularity of their data.

Parameters:

freqstr, DateOffset

Frequency to use for the returned period.

Examples

pd.Period.now('h')
Period('2023-06-12 11:00', 'h')