$beginOfDay = strtotime("today", $timestamp);
$endOfDay = strtotime("tomorrow", $beginOfDay) - 1;
date_default_timezone_set('UTC'); // set timezone
$timestamp = time(); // get current epoch time
$format = "Y-m-d h:i:sa"; // format for date output
$formatted_date = date($format,$timestamp)); // convert timestamp to format
echo($formatted_date);