I have to calculate a sale end time relative to today,
I have the sale end time variable in this format {%d/%m/%Y %H:%M:%S}
e.g.:(31/07/2016 18:27:58)
.
What I'm trying to do is to show ends: 8 days 06:10:29
.
I can't use php code in the template because I'm using smarty 3 and I'm not an expert in smarty.
Change your date1 and date2 values
{assign var="date1" value= $smarty.now}
{assign var="date2" value= $smarty.now+20*24*60*60}
{assign var="dateDiff" value=$date2 - $date1}
{$dateDiff|date_format:'%Y-%m-%d %H:%M:%S'}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With