Skip to content

Instantly share code, notes, and snippets.

@hanigamal
Created June 25, 2013 00:52
Show Gist options
  • Save hanigamal/5855051 to your computer and use it in GitHub Desktop.
Save hanigamal/5855051 to your computer and use it in GitHub Desktop.
function get_day_name($timestamp) {
$date = date('d/m/Y', $timestamp);
if($date == date('d/m/Y')) {
$day_name = 'Today';
} else if($date == date('d/m/Y',now() - (24 * 60 * 60))) {
$day_name = 'Yesterday';
}
return $date;
}
print date('G:i:s', $last_access).' '.get_day_name($last_access);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment