Formatting dates with Mako templates

In my mako template, I have:

<p>${item.addDate}</p> 

It returns:

2012-12-27 19:50:00

but I would like to get:

12/27/2012 19:50

Do you have any great filters, format features?

+7
source share
1 answer

According to google , strftime should do the job:

 ${post.date.strftime('%Y/%m/%d %H:%M') 

Also according to google:

 <%! from time import strftime as time %> It is the ${"%d of %B" | time} 
+11
source

All Articles