Zitat von
Spooky
Das wäre zu einfach.
Ich muss Datum und Uhrzeit trennen.
Sonst bekomme ich mit
PHP-Code:
<?= date('c', …) ?>
bei nicht gesetzter Uhrzeit
HTML-Code:
2022-10-14T00:00:00+02:00
Ohne Zeitangabe soll aber nur der Tag ausgegeben werden.
Siehe Auszug aktueller Stand:
PHP-Code:
<?php elseif($this->eventStatus == "3"): ?>
<meta itemprop="eventStatus" content="https://schema.org/EventRescheduled">
<?php if ($this->endDate): ?>
<meta itemprop="startDate" content="<?php echo date("Y-m-d", $this->begin); ?><?php if ($this->addTime!=""): ?>T<?php echo date("H:i:00+02:00", $this->begin); ?><?php endif ;?>">
<meta itemprop="endDate" content="<?php echo date("Y-m-d", $this->endDate); ?><?php if ($this->addTime!="" AND $this->endTime): ?>T<?php echo date("H:i:00+02:00", $this->end); ?><?php endif ;?>">
<?php else: ?>
<meta itemprop="startDate" content="<?php echo date("Y-m-d", $this->begin); ?><?php if ($this->addTime!=""): ?>T<?php echo date("H:i:00+02:00", $this->begin); ?><?php endif ;?>">
<?php if ($this->addTime!="" AND $this->endTime): ?>
<meta itemprop="endDate" content="<?php echo date("Y-m-d", $this->begin); ?>T<?php echo date("H:i:00+02:00", $this->end); ?>">
<?php endif ;?>
<?php endif ;?>
<meta itemprop="previousStartDate" content="<?php echo date("Y-m-d", $this->previousStartDate); ?>">
Lesezeichen