Python
docs.python.org βΊ 3.6 βΊ library βΊ datetime.html
8.1. datetime β Basic date and time types β Python 3.6.15 documentation
Return a string representing the time, controlled by an explicit format string. For a complete list of formatting directives, see strftime() and strptime() Behavior.
GeeksforGeeks
geeksforgeeks.org βΊ python βΊ python-strftime-function
Python strftime() function - GeeksforGeeks
July 12, 2025 - from datetime import datetime now = datetime.now() print(now) # Format: Abbreviated weekday, month, 2-digit year f_1 = now.strftime("%a %m %y") print(f_1) # Format: Full weekday, full year f_2 = now.strftime("%A %m %Y") print(f_2) # Format: 12-hour time with AM/PM and seconds f_3 = now.strftime("%I %p %S") print(f_3) # Format: Day of the year f_4 = now.strftime("%j") print(f_4)
Videos
14:45
Python for Beginners | L26: Strftime and Strptime Methods in Python ...
06:57
Python - How to use strftime(), to format date and time values. ...
05:21
strptime, strftime in datetime explained clearly - Python - YouTube
01:35
How to Format Dates and Times in Python with strftime() - YouTube
22:34
Python Datetime strftime Function | Part - 3 - YouTube
10:31
43. π
Master Date & Time Formatting in Python β° | strftime ...
strftime
strftime.org
Python strftime reference cheatsheet
A quick reference for Python's strftime formatting directives.
Python documentation
docs.python.org βΊ 3 βΊ library βΊ datetime.html
datetime β Basic date and time types
2006 # year 11 # month 21 # day 16 # hour 30 # minute 0 # second 1 # weekday (0 = Monday) 325 # number of days since 1st January -1 # dst - method tzinfo.dst() returned None >>> # Date in ISO format >>> ic = my_datetime.isocalendar() >>> for it in ic: ... print(it) ... 2006 # ISO year 47 # ISO week 2 # ISO weekday >>> # Formatting a datetime >>> my_datetime.strftime("%A, %d.
W3Schools
w3schools.com βΊ python βΊ gloss_python_date_strftime.asp
Python Date strftime() Method
The datetime object has a method for formatting date objects into readable strings. The method is called strftime(), and takes one parameter, format, to specify the format of the returned string:
Programiz
programiz.com βΊ python-programming βΊ datetime βΊ strftime
Python strftime() - datetime to string
Become a certified Python programmer. Try Programiz PRO! ... The strftime() method returns a string representing date and time using date, time or datetime object.
Tutorialspoint
tutorialspoint.com βΊ python βΊ time_strftime.htm
Python time strftime() Method
February 17, 2009 - Similar to the Python time asctime() method, the strftime() method also converts a tuple or struct_time representing, either in UTC or the local time, to a 24-character string of the following form: 'Mon Jan 9 10:51:77 2023'. However, the contrast occurs when the strftime() method formats the string output in a user-friendly way.
Pandas
pandas.pydata.org βΊ docs βΊ reference βΊ api βΊ pandas.Period.strftime.html
pandas.Period.strftime β pandas 3.0.1 documentation
The strftime method provides a way to represent a Period object as a string in a specified format. This is particularly useful when displaying date and time data in different locales or customized formats, suitable for reports or user interfaces. It extends the standard Python string formatting ...
Pandas
pandas.pydata.org βΊ docs βΊ reference βΊ api βΊ pandas.Series.dt.strftime.html
pandas.Series.dt.strftime β pandas 3.0.2 documentation
>>> rng = pd.date_range(pd.Timestamp("2018-03-10 09:00"), periods=3, freq="s") >>> rng.strftime("%B %d, %Y, %r") Index(['March 10, 2018, 09:00:00 AM', 'March 10, 2018, 09:00:01 AM', 'March 10, 2018, 09:00:02 AM'], dtype='str')
Python Morsels
pythonmorsels.com βΊ strptime
Find your strptime/strftime format
Or use the string formatting table on strftime.org or the formatting playground on strfti.me. Note that page you're on includes a string formatting playground as well. If you think you've found a date format that's missing or another bug on this page, please report it to help@pythonmorsels.com.
Codecademy
codecademy.com βΊ docs βΊ python βΊ dates βΊ .strftime()
Python | Dates | .strftime() | Codecademy
January 9, 2025 - The datetime.strftime() method formats time and datetime objects into readable strings on specified format codes. ... Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
Codecademy
codecademy.com βΊ docs βΊ python βΊ time module βΊ .strftime()
Python | Time Module | .strftime() | Codecademy
May 15, 2024 - The strftime() function returns a time string based on one or more formatting codes and a time represented as a tuple or stuct_time format. ... Looking for an introduction to the theory behind programming?
GeeksforGeeks
geeksforgeeks.org βΊ python βΊ time-strftime-function-in-python
time.strftime() function in Python - GeeksforGeeks
July 11, 2025 - time.strftime(format[, t]) function in Python's time module converts a given time tuple (t) or struct_time object into a formatted string based on the specified format. If t is not provided, the function uses the current local time.
WsCube Tech
wscubetech.com βΊ resources βΊ python βΊ strftime
strftime() in Python: Methods, Working, Examples
October 1, 2025 - Learn about Python strftime(), its methods, working, and example. Understand how to format dates and times in Python with this complete tutorial.