Pergunta

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!

Foi útil?

Solução

Tested in Smarty 3

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

Outras dicas

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 ;-)

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top