Kurt111780
Technical User
Hello,
I need to find the difference between a timestamp in the database and the current time.
This adds time to the current time then it is stored in the database.
Then I get the timeStamp from the the database and need to find the difference between that and the current time.
How do I find the difference between these two and output something like:
"7 hours 20 minutes" or "3 days 7 hours 10 minutes"
Thanks
It's only easy when you know how.
I need to find the difference between a timestamp in the database and the current time.
This adds time to the current time then it is stored in the database.
Code:
$timeStamp = date('YmdHis', strtotime('+' . $expireTime . 'hours'));
Then I get the timeStamp from the the database and need to find the difference between that and the current time.
Code:
$currentTime = date("YmdHis");
"7 hours 20 minutes" or "3 days 7 hours 10 minutes"
Thanks
It's only easy when you know how.