Fork me on GitHub

python-utils

The online playground for Python utilities

Powered by Unicorn

strftime

date, datetime, and time objects all support a strftime(format) method to create a string representing the time specified by the format string.

string format

string, decimal, and float objects all have a format(format_string) method that can do basic string manipulation.

Django date filter

Formats a date according to the given format. Uses a similar format as PHP’s date() function with some differences.

Code

datetime.strftime("")

Result

n/a

Code

n/a

Result

n/a

Code

{{ datetime|date:"" }}

Result

Oct. 12, 2024