pandas.DatetimeIndex.strftime

pandas 3.1.1 · Index objects · method

Format a time value using strftime directives such as %Y-%m-%d. Period.strftime is deprecated in pandas 3.1.1.

Call syntax

DatetimeIndex.strftime(date_format)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
date_format Required
Positional or keyword
str

Specify datetime parsing or formatting directives such as "%Y-%m-%d".

Returns

ndarray[object]