private static function _parseDate($string)
    {
        if ($string == '') {
            $timestamp = 0;
        } else {
            // all times are in UTC according to GPG documentation
            $timeZone = new DateTimeZone('UTC');

            if (strpos($string, 'T') === false) {
                // interpret as UNIX timestamp
                $string = '@' . $string;
            }

            $date = new DateTime($string, $timeZone);

            // convert to UNIX timestamp
            $timestamp = intval($date->format('U'));
        }

        return $timestamp;
    }
private static function _parseDate($string)
    {
        if ($string == '') {
            $timestamp = 0;
        } else {
            // all times are in UTC according to GPG documentation
            $timeZone = new DateTimeZone('UTC');

            if (strpos($string, 'T') === false) {
                // interpret as UNIX timestamp
                $string = '@' . $string;
            }

            $date = new DateTime($string, $timeZone);

            // convert to UNIX timestamp
            $timestamp = intval($date->format('U'));
        }

        return $timestamp;
    }
private static function _parseDate ( $ string ) { if ( $ string == '' ) { $ timestamp = 0 ; } else { // all times are in UTC according to GPG documentation $ timeZone = new DateTimeZone ( 'UTC' ) ; if ( strpos ( $ string , 'T' ) === false ) { // interpret as UNIX timestamp $ string = '@' . $ string ; } $ date = new DateTime ( $ string , $ timeZone ) ; // convert to UNIX timestamp $ timestamp = intval ( $ date -> format ( 'U' ) ) ; } return $ timestamp ; }
Parses a date string as provided by GPG into a UNIX timestamp

@param string $string the date string.

@return integer the UNIX timestamp corresponding to the provided date
string.
Parses a date string as provided by GPG into a UNIX timestamp