Hello all,
I'd like to add the timezone Europe/Zurich to my Calendar.
I do the following:
$phpDateTimeZone = new PhpDateTimeZone('Europe/Zurich');
$timeZone = TimeZone::createFromPhpDateTimeZone(
$phpDateTimeZone,
new DateTimeImmutable('2023-05-01 00:00:00', $phpDateTimeZone),
new DateTimeImmutable('2099-12-31 23:59:59', $phpDateTimeZone),
);
$events = [];
// generate all events here
$event = new Event();
$event->setOccurrence(
new TimeSpan(
new DateTime(new DateTimeImmutable("2024-05-21 10:00:00"), true),
new DateTime(new DateTimeImmutable("2024-05-21 11:00:00"), true),
);
// ...
$calendar = new Calendar($events);
$calendar->addTimeZone($timeZone);
When validating the iCal on the website https://icalendar.org/validator.html, I get the following errors (for all events):
Invalid TZID value or missing VTIMEZONE component (Europe/Paris) [near line # 5]
The strange thing is: Europe/Paris is never mentioned in my code!
If I switch the boolean in the DateTime constructor to false, errors disappear but then my iCal clients use UTC.
Hello all, I'd like to add the timezone
Europe/Zurich
to myCalendar
. I do the following:When validating the iCal on the website https://icalendar.org/validator.html, I get the following errors (for all events):
Invalid TZID value or missing VTIMEZONE component (Europe/Paris) [near line # 5]
The strange thing is: Europe/Paris is never mentioned in my code! If I switch the boolean in theDateTime
constructor tofalse
, errors disappear but then my iCal clients use UTC.Thank you all.