Search code examples
icalendar

Why are my times screwed up on some devices but fine on others?


I have an icalendar I generate via PHP so people can download the latest schedule to their phones. It works great except that the game times are off by 6 hours on my iPhone. The game time is perfectly fine displaying on Windows calendar.

I've tried playing with the timezones and times but cannot get them to be equal on all platforms.

The calendar is viewable at: webcal://cal.outbackthunder.com


Solution

  • Dawson, your ics file at http://cal.outbackthunder.com has the event dates specified in 'local' or 'floating' times.

    So the importing app will probably make the events be that time in it's timezone. 8am is 8am in all timezones (think of a travellers alarm clock - where they want to wake at 8m no matter the timezone they are in, vs a reminder to call their partner at 8am in the home timezone, where they'd then want it to adjust to the traveling timezone.)

    Either add a Z and issue date-times in UTC, or add the TZID identifer of the timezone.

    See https://www.rfc-editor.org/rfc/rfc5545#section-3.3.5.

    See these examples in the spec:

    Example: The following represents July 14, 1997, at 1:30 PM in New York City in each of the three time formats, using the "DTSTART" property.

       DTSTART:19970714T133000                   ; Local time
       DTSTART:19970714T173000Z                  ; UTC time
       DTSTART;TZID=America/New_York:19970714T133000
                                                 ; Local time and time
                                                 ; zone reference
    

    Also try running your ics file through as many validators as you can find if you want the general public to be able to use the url. They tend to report slightly differently. EG: one says of http://cal.outbackthunder.com

    DATE-TIME value in [DTSTAMP] must be specified in UTC time

    Property [ORGANIZER] must be specified once