VOOZH about

URL: https://www.geeksforgeeks.org/pandas/pandas-series-dt-strftime/

⇱ Pandas Series dt.strftime() Method | Change Date Format in Series - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Pandas Series dt.strftime() Method | Change Date Format in Series

Last Updated : 11 Jul, 2025

The dt.strftime() method converts the datetime objects in the Pandas Series to a specified date format.

The function returns an index of formatted strings specified by date_format, which supports the same string format as the Python standard library.

Example

Output:

šŸ‘ dt.strftime output example

Syntax

Syntax: Series.dt.strftime(Date_Format) 

Parameter 

  • date_format : Date format string (e.g. ā€œ%Y-%m-%dā€) 

Returns: NumPy ndarray of formatted string

How to change the Date Format of DateTime objects in a Pandas Series

To change the date format of DateTime objects in a Pandas Series we use the dt.strftime method of the Pandas library in Python.

To understand it better, let us look at some example

Example:

Output:

šŸ‘ datetime series created

Now we will use the Series dt.strftime() function to convert the dates in the series object to the specified format.

Output :

šŸ‘ date format changed after dt.strftime

As we can see in the output, the dt.strftime() function has successfully converted the dates in the given series object to the specified format.

Comment

Explore