문제

I have a question about the date format in smarty.

I got a smarty variable: [{ $order->oxorder__oxorderdate->value }]

This variable give me: 2013-03-10 10:45:17

Now I want do add 14 days, remove the time and change the format of the date:

So my wish is now to get this: 24.03.2013

Is this possible and how can i do this directly in the smarty/.tpl file?

Thank you for help and greetings!

도움이 되었습니까?

해결책

Tested in Smarty 3

{"$order->oxorder__oxorderdate->value +14 Days"|date_format:'d.m.Y'}

다른 팁

I think a found a food way to do that :

{assign var="date" value= $order->oxorder__oxorderdate->value|@strtotime + (60*60*24*7)}
{assign var="date2" value=$date|date_format:"%d/%m/%Y"}
{$date2}

Change 7 value par the day you want ;-)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top