Kuba Kuba - 3 years ago 286
Smarty Question

Smarty date variable. Add days, change format

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 Source

Tested in Smarty 3

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download