2012-12-31 49 views
7

在我的真子模板我:格式化与真子日期模板

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

它返回:

2012年12月27日19点五十分00秒

,但我想获得:

27/12/2012 19:50

有mako任何漂亮的过滤器,格式函数?

+0

是'addDate'字符串或DateTime对象? –

+0

@BurhanKhalid为什么删除了你的anser? –

+0

我删除了它,因为你的被接受了。 –

回答

11

googlestrftime应该做的工作:

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

另外,根据谷歌:

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