diff --git a/scripts/functions.inc.php b/scripts/functions.inc.php index ec9c5b85941078abe8338a508c1cfeb08db2a3b4..2db3a90471755d6cb9bc70f179c07f8ba5bdcf32 100644 --- a/scripts/functions.inc.php +++ b/scripts/functions.inc.php @@ -13,11 +13,14 @@ function getCAPData() if (stripos($item->description, 'test')) { $isTest = true; } + + $pubDate = (string) $item->children('dc', true)->date; + $pubDateTime = new DateTime($pubDate); $output = array( - 'identifier' => md5((string) $item->children('dc', true)->date), + 'identifier' => md5($pubDate), 'sender' => 'police.unl.edu', - 'sent' => (new DateTime((string) $item->children('dc', true)->date))->format(DateTime::ATOM), + 'sent' => $pubDateTime->format(DateTime::ATOM), 'status' => $isTest ? 'Test' : 'Actual', 'msgType' => 'Alert', 'scope' => 'Public',