View format_reasonable_interval.php
/** | |
* Human-readable and reasonable date-time interval formatter | |
* ---------------------------------------------------------- | |
* Author: Benyamin shoham | |
* ----------------------- | |
* Format an interval to show existing components in a Human Readable fashion | |
* If the interval doesn't have a time component (years, months, etc) | |
* That component won't be displayed. | |
* You can decide how many components will be displayed (e.g. "1 year 2 months" = 2 components) | |
* You can select a delimiter to format the interval (e.g. "1 year aaaand 2 months" |