This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Given two dates (or one date and assume "now" for the second), convert this to | |
* a human-readable string, like "2 months". | |
* | |
* I use this to put "3 months ago" strings into plugins. My use case has the date | |
* coming in as a seconds-only UNIX epoch, so the params are expected at this. | |
* | |
* @param time1 integer Number of seconds since UNIX epoch | |
* @param time2 integer Number of seconds since UNIX epoch | |
* @return string |