fixed date with time in LuftfahrtBundesAmtBridge (#3987)

This commit is contained in:
hleskien 2024-02-18 19:19:33 +01:00 committed by GitHub
parent e65155f440
commit 932f20d434
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -26,8 +26,13 @@ class LuftfahrtBundesAmtBridge extends XPathAbstract
protected function formatItemTimestamp($value)
{
$value = trim($value);
$dti = DateTimeImmutable::createFromFormat('d.m.Y', $value);
$dti = $dti->setTime(0, 0, 0);
if (strpos($value, 'Uhr') !== false) {
$value = str_replace(' Uhr', '', $value);
$dti = DateTimeImmutable::createFromFormat('d.m.Y G:i', $value);
} else {
$dti = DateTimeImmutable::createFromFormat('d.m.Y', $value);
$dti = $dti->setTime(0, 0);
}
return $dti->getTimestamp();
}