add timestamp

This commit is contained in:
Christopher 2019-03-12 20:53:13 +01:00
parent a3f46f2822
commit 6c6cee81bc
1 changed files with 12 additions and 5 deletions

View File

@ -24,22 +24,29 @@ foreach ($icalLines as $line)
$eventData['SUMMARY'] = str_replace("[UNHB] ", "", $data[1]);
if($data[0] == "DTSTAMP")
$eventData['DTSTAMP'] = date('d M Y', strtotime(substr($data[1], 0, 8)));
$eventData['DTSTAMP'] = strtotime(substr($data[1], 0, 8));
if($data[0] == "END" and $data[1] == "VEVENT")
{
array_unshift($events, $eventData);
if($eventData['DTSTAMP'] > time())
{
array_unshift($events, $eventData);
if(count($events) == 4)
break;
}
$eventData = array();
}
if(count($events) == 3)
break;
}
foreach ($events as $thisEvent)
{
echo "<h1>".$thisEvent['DTSTAMP']." => ".$thisEvent['SUMMARY']."</h1>";
echo "<h1>".date('d M Y', $thisEvent['DTSTAMP'])." (".$thisEvent['DTSTAMP']." - ".time().") => ".$thisEvent['SUMMARY']."</h1>";
}
?>