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.
我想添加到 $order->date_add 这是日期,额外的日子。天数在变量 $order->days 我有这样的代码
{$order->date_add|cat:' +60 days'|date_format:"%d-%m-%Y"}
但我想用变量 $order->days 替换数字“60”。不幸的是,我不能在 php 中做到这一点 - 我必须在 smarty 中做到这一点。可能吗?如何用变量替换 60?
{$ order-> date_add} 中有什么格式的日期?
如果有时间戳,您可以这样做:
{$order->date_add+20*24*60*60|date_format:"%d-%m-%Y"} //+20 days
或者
{$order->date_add + $order->days|date_format:"%d-%m-%Y"} // + {$order->days} days