Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
echo date('Y-m-d',time())
我得到 2012-07-16 ,但是当 smarty 输出是
{$smarty.now | date_format : "%Y-%I-%d"}
我得到 2012-04-16
我已经确定 time_zone 设置正确。
因为%I是小时......尝试:
%I
{$smarty.now | date_format : "%Y-%m-%d"}
%m - 十进制数的月份(范围 01 到 12)
文档在这里date_format
date_format