Date

Filepath: phork/php/utilities/Date.class.php

The Date class is used to generate a formatted date string with the option of returning a "time ago" string for dates that occurred within 24 hours, or an "on [date]" string for dates that fall outside the 24 hour period. For example: "4 hours ago", "16 minutes ago", "on February 13th", etc.

The format of the "on [date]" string is determined by an argument passed using the PHP date format.

It can also be used to display formatted dates relative to a user's timezone.


Example

Date::setClientOffset(-8);
print Date::getTimeAgo(strtotime($strDate), 24, 'M d, y @ g:ia');