🌐
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)
🌐
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.
🌐
PYnative
pynative.com β€Ί home β€Ί python β€Ί python datetime β€Ί python datetime format using strftime()
Python DateTime Format using Strftime() – PYnative
May 6, 2022 - Learn to represent Python date and time into various formats using the strftime(). Use format codes to represent dates in dd-mm-yyyy HH:MM:SS format
🌐
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 ...
Find elsewhere
🌐
Analytics Vidhya
analyticsvidhya.com β€Ί home β€Ί all about python strftime() function
Python strftime() Function - Analytics Vidhya
May 27, 2025 - The `strftime` function in Python stands for β€œstring format time” and is part of the `datetime` module. It converts a `datetime` object into a string based on a specified format representing the date and time.
🌐
Pandas
pandas.pydata.org β€Ί docs β€Ί reference β€Ί api β€Ί pandas.Series.dt.strftime.html
pandas.Series.dt.strftime β€” pandas 3.0.1 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!
🌐
freeCodeCamp
freecodecamp.org β€Ί news β€Ί strftime-in-python
strftime() Python – Datetime Format Tutorial
July 15, 2022 - strftime() is a Python date method you can use to convert dates to strings.
🌐
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?
🌐
Python
docs.python.org β€Ί 3 β€Ί library β€Ί time.html
time β€” Time access and conversions
The format parameter uses the same directives as those used by strftime(); it defaults to "%a %b %d %H:%M:%S %Y" which matches the formatting returned by ctime(). If string cannot be parsed according to format, or if it has excess data after parsing, ValueError is raised.
🌐
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.
🌐
w3resource
w3resource.com β€Ί python β€Ί python-strftime.php
Python strftime() function
June 6, 2024 - Python strftime() function: The strftime() function returns a string representing the date, controlled by an explicit format string. Format codes referring to hours, minutes or seconds will see 0 values.
🌐
GeeksforGeeks
geeksforgeeks.org β€Ί python β€Ί how-to-format-date-using-strftime-in-python
How to Format date using strftime() in Python ? - GeeksforGeeks
July 23, 2025 - from datetime import datetime # current time and date # datetime object time = datetime.now() print("Without formatting:", time) # formatting date using strftime print("After formatting:", time.strftime("%b %d, %Y"))