Search code examples
calendartimezonegcal

Creating Google Calendar link, convert timezone and format


I'm trying to create a google calendar event dynamically and I have most of it working except for the time

https://calendar.google.com/calendar/render?action=TEMPLATE&text=Your+appointment&ctz=Europe/Brussels&dates=20170530T154000Z/20170530T164000Z&details=some+service&location=Salon,+Belgium&trp=false&sprop&sprop=name:&sf=true&output=xml#main_7

Although google calendar displays the timezone as Europe/Brussels and GMT+2 it displays the time as two hours later than what I pass it. In the above instance I want it to create an event at 15.40 CET (UTC+2) but it creates it at 17.40 instead.

Also, is there a way to pass the date in DD/MM/YYYY format instead and have the calendar understand and convert it?


Solution

  • The answer is quite simple, apparently. Just remove the Z from the timestamp to un-force UTC!