src/Chippyash/Validation/Common/ISO8601/SplitDate.php
protected function splitTime($value)
    {
        //guard
        if (empty($value)) {
            return array(null, null);
        }

        //try to find zone, z == UTC
        $partsZ = explode('z', $value);
        $partsM = explode('-', $value);
        $partsP = explode('+', $value);
        if ($this->laxZone) {
            //trim the time part cus there may be a space
            $partsZ[0] = rtrim($partsZ[0]);
            $partsM[0] = rtrim($partsM[0]);
            $partsP[0] = rtrim($partsP[0]);
        }
        //guard
        if (count($partsZ) == 0 && count($partsM) == 0 && count($partsP) == 0) {
            return array(null, null);
        }
        //UTC timezone stated
        if (count($partsZ) == 2 && empty($partsZ[1])) {
            $this->zonepartFound = true;
            return array($partsZ[0], $this->getUTCTimezone());
        }

        //minus timezone stated
        if (count($partsM) == 2) {
            $this->zonepartFound = true;
            return array($partsM[0], "-{$partsM[1]}");
        }

        //plus timezone stated
        if (count($partsP) == 2) {
            $this->zonepartFound = true;
            return array($partsP[0], "+{$partsP[1]}");
        }

        //no zone found
        return array((empty($value) ? null : $value), null);
    }
protected function splitTime($value)
    {
        //guard
        if (empty($value)) {
            return array(null, null);
        }

        //try to find zone, z == UTC
        $partsZ = explode('z', $value);
        $partsM = explode('-', $value);
        $partsP = explode('+', $value);
        if ($this->laxZone) {
            //trim the time part cus there may be a space
            $partsZ[0] = rtrim($partsZ[0]);
            $partsM[0] = rtrim($partsM[0]);
            $partsP[0] = rtrim($partsP[0]);
        }
        //guard
        if (count($partsZ) == 0 && count($partsM) == 0 && count($partsP) == 0) {
            return array(null, null);
        }
        //UTC timezone stated
        if (count($partsZ) == 2 && empty($partsZ[1])) {
            $this->zonepartFound = true;
            return array($partsZ[0], $this->getUTCTimezone());
        }

        //minus timezone stated
        if (count($partsM) == 2) {
            $this->zonepartFound = true;
            return array($partsM[0], "-{$partsM[1]}");
        }

        //plus timezone stated
        if (count($partsP) == 2) {
            $this->zonepartFound = true;
            return array($partsP[0], "+{$partsP[1]}");
        }

        //no zone found
        return array((empty($value) ? null : $value), null);
    }
protected function splitTime ( $ value ) { //guard if ( empty ( $ value ) ) { return array ( null , null ) ; } //try to find zone, z == UTC $ partsZ = explode ( 'z' , $ value ) ; $ partsM = explode ( '-' , $ value ) ; $ partsP = explode ( '+' , $ value ) ; if ( $ this -> laxZone ) { //trim the time part cus there may be a space $ partsZ [ 0 ] = rtrim ( $ partsZ [ 0 ] ) ; $ partsM [ 0 ] = rtrim ( $ partsM [ 0 ] ) ; $ partsP [ 0 ] = rtrim ( $ partsP [ 0 ] ) ; } //guard if ( count ( $ partsZ ) == 0 && count ( $ partsM ) == 0 && count ( $ partsP ) == 0 ) { return array ( null , null ) ; } //UTC timezone stated if ( count ( $ partsZ ) == 2 && empty ( $ partsZ [ 1 ] ) ) { $ this -> zonepartFound = true ; return array ( $ partsZ [ 0 ] , $ this -> getUTCTimezone ( ) ) ; } //minus timezone stated if ( count ( $ partsM ) == 2 ) { $ this -> zonepartFound = true ; return array ( $ partsM [ 0 ] , "-{$partsM[1]}" ) ; } //plus timezone stated if ( count ( $ partsP ) == 2 ) { $ this -> zonepartFound = true ; return array ( $ partsP [ 0 ] , "+{$partsP[1]}" ) ; } //no zone found return array ( ( empty ( $ value ) ? null : $ value ) , null ) ; }
Split timezone by its parts

@param  string $value
@return array[time, zone]
Split timezone by its parts