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

UTC Format sometimes not recognized on some calendars #500

Open
globenewmedia opened this issue Feb 9, 2023 · 3 comments
Open

UTC Format sometimes not recognized on some calendars #500

globenewmedia opened this issue Feb 9, 2023 · 3 comments

Comments

@globenewmedia
Copy link

Using version 2.x I have seen that giving no timezone you create a date like this assuming calendars accept that as UTC

DTSTART:20230207T000000
DTEND:20230210T000000

but should it not be

DTSTART:20230207T000000Z
DTEND:20230210T000000Z

to be recognized as UTC time?

@jgulledge19
Copy link

@markuspoerschke any review on this issue? I have set up an event and trying to get the time load correctly into Outlook and this seems be an issue for me as well.

@mipapo
Copy link

mipapo commented Jan 22, 2024

Yep, I would also say that this is wrong - Don't get the correct one on Google calender too without "Z"

@richardhj
Copy link

I work with UTC in the underlying database but set the TimeZone to Europe/Berlin (primary region of users). This works for Apple, but not all clients (I guess Outlook?).

Has someone found a proper way of handling this?
Modifiyng the DateTime object to Europe/Berlin and $useTimezone=false?

// WORKING ON APPLE CALENDAR BUT NOT ALL CLIENTS
$tz = new \DateTimeZone('Europe/Berlin');

(new Event())
  ->setOccurrence(new TimeSpan(
      // Setting the timezone will not change the underlying point-in-time.
      // But showing "UTC" to the user might be confusing.
      new DateTime($date->setTimezone($tz), true),
      new DateTime($date->setTimezone($tz), true)
  ))
;

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

4 participants