7
在我的真子模板我:格式化与真子日期模板
<p>${item.addDate}</p>
它返回:
2012年12月27日19点五十分00秒
,但我想获得:
27/12/2012 19:50
有mako任何漂亮的过滤器,格式函数?
在我的真子模板我:格式化与真子日期模板
<p>${item.addDate}</p>
它返回:
2012年12月27日19点五十分00秒
,但我想获得:
27/12/2012 19:50
有mako任何漂亮的过滤器,格式函数?
据google,strftime
应该做的工作:
${post.date.strftime('%Y/%m/%d %H:%M')
另外,根据谷歌:
<%! from time import strftime as time %>
It is the ${"%d of %B" | time}
是'addDate'字符串或DateTime对象? –
@BurhanKhalid为什么删除了你的anser? –
我删除了它,因为你的被接受了。 –