Skip to content

Instantly share code, notes, and snippets.

@justquick
Created August 24, 2010 14:47
Show Gist options
  • Save justquick/547671 to your computer and use it in GitHub Desktop.
Save justquick/547671 to your computer and use it in GitHub Desktop.
def format_time(date_to_be_formatted, format_string):
return date_to_be_formatted.strftime(format_string)
format_time.function = True
format_time.filter = True
{% format_time entry.pub_date "%a, %d %b %Y" as pub_date %}
{{ entry.pub_date|format_time:"%a, %d %b %Y" }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment