getTimeFormat(); return current_time($format); } function getCurrentDate($format=false) { if (empty($format)) $format = $this->getDateFormat(); return $this->getCurrentTime($format); } function formatTime($timestamp, $format=false) { if (empty($format)) $format = $this->getTimeFormat(); return date($format, $timestamp); } /** * Generates a list of time strings within an interval, * formatted and mapped from DEFAULT_TIME_FORMAT to Wordpress time strings. */ function getTimeInterval( $start_time='00:00:00', $time_step='+1 hour', $total_steps=24 ) { $steps = array(); $formatted_time = $start_time; $timestamp = strtotime($formatted_time); for ($step = 0; $step < $total_steps; $step += 1) { $formatted_time = $this->formatTime($timestamp, self::DEFAULT_TIME_FORMAT); $label_time = $this->formatTime($timestamp); $steps[$formatted_time] = $label_time; $timestamp = strtotime($time_step, $timestamp); } return $steps; } }