PHP function : cuteDate()
  • receives an integer time/date value; created easily with mktime() or pulled from a database
  • compares it against today’s date()
  • returns a user-friendly text string representation of the difference.
i.e. “last Thursday,” “yesterday,” “a week ago,” “a moment ago,” “October 3rd,” or “Mar. 26th ‘05.”
Ironically, to test I recommend this format:
echo cuteDate( strtotime('+4 hours') );