0

I have the following link for a user to create a Google calendar event

https://calendar.google.com/calendar/render?action=TEMPLATE&text=Your+Event+Name&dates=20140127T224000Z/20140320T221500Z&ctz=America/Los_Angeles&details=For+details,+link+here:+http://www.example.com&location=Waldorf+Astoria,+301+Park+Ave+,+New+York,+NY+10022&sf=true&output=xml#eventpage_6

I originally found this out using the example from Link to add to google calendar

The issue I am having is to do with the time part of the URL which is

&dates=20140127T224000Z/20140320T221500Z

to break this down the format for this in which Google uses to determine the start/end date and time is

Ymd\\THi00\\Z

So you understand Google uses GMT as a standard time in the url and converts it correctly according to the users settings in their Google account. For instance (GMT-07:00) Pacific Time

So let's take just the start time of this URL which is

224000 which is Hi00 or Hour:Minutes:Seconds

In my Google calendar, my timezone settings are set to Pacific which is -7. Converting 224000 GMT to -7 Pacific you get 154000 which should be 3:40 PM

Problem is when you click the link, (if you are pacific) it is showing me the start time as 2:40 PM

What's even weirder is the end time which is 221500 shows as 3:15 PM. The end time hour is still the same as the start time but shows 1 hour ahead. I get that Google is probably assuming that I mean 1 hour ahead and makes that change for me, OR by default Google probably adds 1 hour more from the start time automatically.

I am not sure if I am understanding the format Google uses GMT in the URL or there is an issue with my coding and how I am representing that. Anyone have any info on this?

Community
  • 1
  • 1
Cesar Bielich
  • 4,754
  • 9
  • 39
  • 81

1 Answers1

1

You may want to check this page wherein it discussed how Google Calendar uses time zones. As mentioned,

When you create an event, you'll see it in your local time zone. It will also show up in the local time zones for anyone you invite, even if they're in a different time zone.

And, on Daylight savings time:

Google Calendar uses Coordinated Universal Time (UTC) to help avoid issues with daylight savings time.

When events are created, they're converted into UTC, but you'll always see them in your local time.

If an area switches their time zone, events created before we knew about the change might be in the wrong time zone.

With this, you may want to try the given workarounds in this thread and see if it will help you.

Community
  • 1
  • 1
Teyam
  • 7,686
  • 3
  • 15
  • 22
  • Could you help me with time format issue like this? https://stackoverflow.com/questions/66938342/add-to-google-calendar-render-link-not-showing-users-local-time – newdeveloper Apr 04 '21 at 16:13