2

On Google Calendar I'm able to manually create an event that starts and ends in different time zones:

Manually entered Google Calendar Entry with different time zones at start and end

I would like to recreate entries like this using the import feature in Google Calendar ((gear) > settings > import & export > (select file) > import).

I have tried the following, which does import, but the resulting calendar entry is incorrect:

BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART;TZID=Eastern Time - New York:20191207T124500
DTEND;TZID=Eastern European Standard Time - Cairo:20191208T050500
DESCRIPTION:Event starting NY 12:45pm (local time) - ending Eastern Europe 5:05am (local time)
LOCATION:Atlantic
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Flight
TRANSP:TRANSPARENT
END:VEVENT
END:VCALENDAR

The resulting entry makes incorrect assumptions about time zones, presuming the entries are zulu or something.

I have also tried to set the TZID parameter to things like "GMT-04:00", but those did not successfully import to Google Calendar at all. And using DTSTART:20191207T124500 or DTSTART:20191207T124500Z works, but doesn't do what I want.

My starting point for this endeavor was to export a calendar entry that had the time zone details, but that did not export with the time zone details (only exported in GMT+00:00 zulu).

So in summary, I'm able to import, just need to figure out how to import an event and have it show different starting and ending time zones.

migrated from superuser.com Sep 13 at 20:43

This question came from our site for computer enthusiasts and power users.

2

You must define the TZIDs used in your iCal file, using the VTIMEZONE component.

For example, add this block of code after END:VEVENT to define the "Eastern Time - New York" timezone:

BEGIN:VTIMEZONE
TZID:Eastern Time - New York
BEGIN:STANDARD
DTSTART:19671029T020000
RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=11
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
TZNAME:EST
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:19870405T020000
RRULE:FREQ=YEARLY;BYDAY=2SU;BYMONTH=3
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
TZNAME:EDT
END:DAYLIGHT
END:VTIMEZONE

The iCalendar Validator is a nice tool to make sure your iCal file conforms to RFC 5545.

  • I saw that I could define a time zone, but I thought that was quite tedious, with both the standard and daylight and associated rules. I didn't know if I could get it right. I need to understand where stock "VTIMEZONE" clips are located so I don't need to write them myself. – Dale Sep 19 at 14:40
  • 1
    The code above is accurate for EST/EDT as of today (may change in the future depending on legislation). If this answered your question, please mark as accepted! – Nick Sep 19 at 18:37
  • I was hoping you'd add where the current definitions of other time zones were. – Dale Sep 19 at 18:43
  • Thanks. I could not find a resource after some quick googling. Sounds like a great idea for a github library. – Nick Sep 19 at 22:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.