1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-07-29 12:50:18 +02:00

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

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();
}