Horde_ActiveSync_Message_Base::_parseDate PHP Method

_parseDate() protected method

Used when decoding an incoming date value from the client.
protected _parseDate ( string $ts ) : Horde_Date | boolean
$ts string The timestamp
return Horde_Date | boolean The Horde_Date or false if unable to decode.
    protected function _parseDate($ts)
    {
        if (preg_match("/(\\d{4})[^0-9]*(\\d{2})[^0-9]*(\\d{2})(T(\\d{2})[^0-9]*(\\d{2})[^0-9]*(\\d{2})(.\\d+)?Z){0,1}\$/", $ts, $matches)) {
            try {
                return new Horde_Date($ts);
            } catch (Horde_Date_Exception $e) {
            }
        }
        return false;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Override parent class so we can normalize the Date object before
  * returning it.
  *
  * @param  [type] $ts [description]
  * @return [type]     [description]
  */
 protected function _parseDate($ts)
 {
     $date = parent::_parseDate($ts);
     // @todo: Remove this in H6.
     if (empty($this->_device)) {
         return $date;
     }
     return $this->_device->normalizePoomContactsDates($date);
 }
All Usage Examples Of Horde_ActiveSync_Message_Base::_parseDate