briannesbitt/Carbon — pull request #97 by mladoux (2014-02-10 18:48:52+00:00)
Title: elapsedForHumans

Fixed issues that were introduced by sleep deprevation. I still see an issue with days sometimes being calculated wrong in tests without timezone. not sure what's causing that, but the same errors happen in diffForHumans, and I believe that was caused by PHP's DateTime.

Script outputs the time elapsed between two given times in a human readable format. It doesn't specify whether the time is from the past or in the future, I leave that up to the individual developer to figure out.

example output

1 year, 23 weeks, 4 days, 6 hours, 10 minutes, 54 seconds

I didn't include months in the break down because it was too much of a headache to calculate it properly, seeing as not all months are the same number of days or even weeks. I will probably add something in to handle that later.