src/util/Date.php
public static function hours($step = 1, $long = false, $start = null) {
        // Set the default start if none was specified.
        if (!$start) {
            $start = $long ? 0 : 1;
        }

        // 24-hour time has 24 hours, instead of 12
        $size = $long ? 23 : 12;
        $step = (int)$step;

        $hours = array();
        for ($i = $start; $i <= $size; $i += $step) {
            $hours[$i] = (string)$i;
        }

        return $hours;
    }
public static function hours($step = 1, $long = false, $start = null) {
        // Set the default start if none was specified.
        if (!$start) {
            $start = $long ? 0 : 1;
        }

        // 24-hour time has 24 hours, instead of 12
        $size = $long ? 23 : 12;
        $step = (int)$step;

        $hours = array();
        for ($i = $start; $i <= $size; $i += $step) {
            $hours[$i] = (string)$i;
        }

        return $hours;
    }
public static function hours ( $ step = 1 , $ long = false , $ start = null ) { // Set the default start if none was specified. if ( ! $ start ) { $ start = $ long ? 0 : 1 ; } // 24-hour time has 24 hours, instead of 12 $ size = $ long ? 23 : 12 ; $ step = ( int ) $ step ; $ hours = array ( ) ; for ( $ i = $ start ; $ i <= $ size ; $ i += $ step ) { $ hours [ $ i ] = ( string ) $ i ; } return $ hours ; }
Number of hours in a day. Typically used as a shortcut for generating a
list that can be used in a form.

$hours = Date::hours(); // 01, 02, 03, ..., 10, 11, 12

@param   integer $step amount to increment each step by
@param   boolean $long use 24-hour time
@param   integer $start the hour to start at
@return  array   A mirrored (foo => foo) array from start-12 or start-23.
Number of hours in a day . Typically used as a shortcut for generating a list that can be used in a form .