Smarty date variable. Add days, change format

Kuba picture Kuba · Mar 21, 2013 · Viewed 7.2k times · Source

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!

Answer

sofl picture sofl · Mar 21, 2013

Tested in Smarty 3

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