function _timeField($date)
    {
        if ($date instanceof Element) {
            return $date;
        }
        $dateObj = new DateTime($date, new DateTimeZone('GMT'));
        $year = $dateObj->format('Y'); // the same way ASN1.php parses this
        if ($year < 2050) {
            return array('utcTime' => $date);
        } else {
            return array('generalTime' => $date);
        }
    }
function _timeField($date)
    {
        if ($date instanceof Element) {
            return $date;
        }
        $dateObj = new DateTime($date, new DateTimeZone('GMT'));
        $year = $dateObj->format('Y'); // the same way ASN1.php parses this
        if ($year < 2050) {
            return array('utcTime' => $date);
        } else {
            return array('generalTime' => $date);
        }
    }
function _timeField ( $ date ) { if ( $ date instanceof Element ) { return $ date ; } $ dateObj = new DateTime ( $ date , new DateTimeZone ( 'GMT' ) ) ; $ year = $ dateObj -> format ( 'Y' ) ; // the same way ASN1.php parses this if ( $ year < 2050 ) { return array ( 'utcTime' => $ date ) ; } else { return array ( 'generalTime' => $ date ) ; } }
Helper function to build a time field according to RFC 3280 section
- 4.1.2.5 Validity
- 5.1.2.4 This Update
- 5.1.2.5 Next Update
- 5.1.2.6 Revoked Certificates
by choosing utcTime iff year of date given is before 2050 and generalTime else.

@param string $date in format date('D, d M Y H:i:s O')
@access private
@return array
Helper function to build a time field according to RFC 3280 section - 4 . 1 . 2 . 5 Validity - 5 . 1 . 2 . 4 This Update - 5 . 1 . 2 . 5 Next Update - 5 . 1 . 2 . 6 Revoked Certificates by choosing utcTime iff year of date given is before 2050 and generalTime else .