We will learn to calculate the time passed since date in days, hours, minutes and seconds. Either you are receiving values in PHP variable from MySQL database, or you are calling an AJAX request, this tutorial will help you in both situations. We will also display the hours, minutes and seconds in leading zeroes. So you will not see time as “7:9:3” but you will see that as “07:09:03” using leading zeroes. You will also learn to get the PHP variable value in Javascript by following this tutorial.

#javascript #php

Calculate time passed in days, hours, minutes and seconds - Javascript, PHP
4.35 GEEK