mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-25 18:19:22 +03:00
Fix intenaldate parser
This commit is contained in:
parent
1de1ecc9c4
commit
7dc9441852
12 changed files with 199 additions and 184 deletions
|
|
@ -55,7 +55,13 @@ class DateTimeHelper
|
|||
*/
|
||||
public static function ParseInternalDateString($sDateTime)
|
||||
{
|
||||
$oDateTime = \DateTime::createFromFormat('d-M-Y H:i:s O', \trim($sDateTime), \MailSo\Base\DateTimeHelper::GetUtcTimeZoneObject());
|
||||
$sDateTime = \trim($sDateTime);
|
||||
if (\preg_match('/^[a-z]{2,4}, /i', $sDateTime)) // RFC2822
|
||||
{
|
||||
return \MailSo\Base\DateTimeHelper::ParseRFC2822DateString($sDateTime);
|
||||
}
|
||||
|
||||
$oDateTime = \DateTime::createFromFormat('d-M-Y H:i:s O', $sDateTime, \MailSo\Base\DateTimeHelper::GetUtcTimeZoneObject());
|
||||
return $oDateTime ? $oDateTime->getTimestamp() : 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue