getTimestamp() : 0; } /** * Parse date string formated as "10-Jan-2012 01:58:17 -0800" * IMAP INTERNALDATE Format * * @param string $sDateTime * * @return int */ public static function ParseInternalDateString($sDateTime) { $oDateTime = \DateTime::createFromFormat('d-M-Y H:i:s O', \trim($sDateTime), \MailSo\Base\DateTimeHelper::GetUtcTimeZoneObject()); return $oDateTime ? $oDateTime->getTimestamp() : 0; } /** * Parse date string formated as "2011-06-14 23:59:59 +0400" * * @param string $sDateTime * * @return int */ public static function ParseDateStringType1($sDateTime) { $oDateTime = \DateTime::createFromFormat('Y-m-d H:i:s O', \trim($sDateTime), \MailSo\Base\DateTimeHelper::GetUtcTimeZoneObject()); return $oDateTime ? $oDateTime->getTimestamp() : 0; } }