/*
- Format Date (Unix)
- Formats unix time (number of seconds passed since January 1st, 1970 to human
readable time like "January 1, 2015 at 3:35pm"
$unixTime - The time to be formatted (current time can be fetched with the php
function time() )
*/
public function formatDateUnix($unixTime, $dateOnly = false) {
$formatted = date("F d, Y", $unixTime);
if (!$dateOnly) {
$formatted .= " at ";
$formatted .= date("g:ia", $unixTime);
}
return $formatted;
}
Comments