To find out time elapsed i usually use time()
instead of date()
and formatted time stamps.
Then get the difference between the latter value and the earlier value and format accordingly. time()
is differently not a replacement for date()
but it totally helps when calculating elapsed time.
example:
The value of time()
looks something like this 1274467343
increments every second. So you could have $erlierTime
with value 1274467343
and $latterTime
with value 1274467500
, then just do $latterTime - $erlierTime
to get time elapsed in seconds.