Try to search your question here, if you can't find : Ask Any Question Now ?

How to express the difference between two dates in a human-readable format

HomeCategory: stackoverflowHow to express the difference between two dates in a human-readable format
pragati asked 2 weeks ago

If I have two dates – $end_date and $start_date, how can I express the difference between the two in a format such as “2 Years : 4 Months : 2 Days”?

I know that I can get the difference between the two dates like so:

$dif=strtotime($end_date)-strtotime($today);

But how can I convert that result into the human-readable format, like that shown above?

1 Answers
Best Answer
Jyoti answered 2 weeks ago
Your Answer

19 + 11 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com