DEV Community

Discussion on: How to find the difference between two dates in php?

Collapse
 
ri5hirajp profile image
Rishiraj Purohit • Edited

A simple trick is to convert dates to timestamp and then subtracting, you'll get difference in seconds.

$date_stamp = strtotime($date);

Another option is date_diff

php.net/manual/en/function.date-di...