Skip to content

Commit

Permalink
Update ElementDate.php
Browse files Browse the repository at this point in the history
  • Loading branch information
smalot authored Mar 28, 2019
1 parent b2534af commit ee2dae3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Smalot/PdfParser/Element/ElementDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ public static function parse($content, Document $document = null, &$offset = 0)
}

$format = self::$formats[strlen($name)];
$date = \DateTime::createFromFormat($format, $name,new \DateTimeZone('UTC'));
$date = \DateTime::createFromFormat($format, $name, new \DateTimeZone('UTC'));
} else {
// special cases
if (preg_match('/^\d{1,2}-\d{1,2}-\d{4},?\s+\d{2}:\d{2}:\d{2}[\+-]\d{4}$/', $name)) {
$name = str_replace(',', '', $name);
$format = 'n-j-Y H:i:sO';
$date = \DateTime::createFromFormat($format, $name,new \DateTimeZone('UTC'));
$date = \DateTime::createFromFormat($format, $name, new \DateTimeZone('UTC'));
}
}

Expand Down

0 comments on commit ee2dae3

Please sign in to comment.