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