|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Toniomoricone Smarty n00b
Joined: 26 Aug 2013 Posts: 2
|
Posted: Mon Aug 26, 2013 9:18 am Post subject: add 6 month to a date in prestashop invoice |
|
|
Hello,
i try to add 6 month to this date in the invoice.tpl :
{$order->date_add|date_format:"%d-%m-%Y"}
I have tried this :
{assign var=date_val value=$order->date_add+"6 month"}
{$date_val|date_format:"%d-%m-%Y"}
but it doesn't work.
Thanks for your help. |
|
Back to top |
|
Toniomoricone Smarty n00b
Joined: 26 Aug 2013 Posts: 2
|
Posted: Mon Aug 26, 2013 11:59 am Post subject: |
|
|
The solution :
Code: |
{capture assign="unix"}{$order->date_add}{/capture}
{math equation="x + y" x=$unix|strtotime y=15897600 assign="6mois_date"}
{$6mois_date|date_format:"%d-%m-%Y"} |
|
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Mon Aug 26, 2013 3:29 pm Post subject: |
|
|
The following code should do the job
Code: | {strtotime("+6 month",$order->date_add)|date_format:"%d-%m-%Y"} |
|
|
Back to top |
|
MemphisChild Smarty n00b
Joined: 14 Sep 2013 Posts: 1 Location: usa
|
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|