Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid TZID value or missing VTIMEZONE component (Europe/Paris) #612

Open
ncavallini opened this issue May 21, 2024 · 0 comments
Open

Invalid TZID value or missing VTIMEZONE component (Europe/Paris) #612

ncavallini opened this issue May 21, 2024 · 0 comments

Comments

@ncavallini
Copy link

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.

Thank you all.

@ncavallini ncavallini changed the title Error adding a timezone Invalid TZID value or missing VTIMEZONE component (Europe/Paris) May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant