I am using opencart and want to display text (product ending time) like this:
end in 09 dys 12 hours 30 Mins
I have an ends_date from the table but now I want to calculate the time difference between ends_date and the server time and display in the above format, in PHP or jQuery.
Thanks!
From there you have
$time_diffthat represents the number of seconds till it’s over. Do some / 60 for minutes and then hours and then / 24 for days. Make sure you only do that if $time_diff > 0! Math. It works. 🙂