0

I am facing this issue in Ical.Net Version=4.0.1.0 and lower, When we get "GMT-0500" in DTSTART/DTEND then it is giving same utc time as local time in AsUtc. But If I replace "GMT-0500" to "Canada/Eastern" manually in ics its giving correct utc time in AsUtc.

Following is not working fine -:

DTSTART;TZID=GMT-0500:20181213T190000
DTEND;TZID=GMT-0500:20181213T220000

Following works fine -:

DTSTART;TZID=Canada/Eastern:20181213T190000
DTEND;TZID=Canada/Eastern:20181213T220000
rianjs
  • 7,767
  • 5
  • 24
  • 40
Priyank Kotiyal
  • 241
  • 2
  • 13

1 Answers1

1

In general, I suggest you familiarize yourself with the actual time zone names instead of guessing as to what they might be, and hoping for the best.

There were also some bugs with caching AsUtc values, as I noted in the release notes. I suggest upgrading to 4.latest. It should be backwards compatible.

Matt Johnson-Pint
  • 230,703
  • 74
  • 448
  • 575
rianjs
  • 7,767
  • 5
  • 24
  • 40
  • 1
    Actually, the signs of etc time zones are inverted. Edited for you. – Matt Johnson-Pint Feb 08 '19 at 18:37
  • @MattJohnson - I don't think so? `America/Toronto` is UTC-5 for ~half the year. UTC+5 would be... somewhere in eastern Europe/Asia, wouldn't it? (At any rate, I was using the OP's values.) – rianjs Feb 08 '19 at 19:28
  • 1
    `Etc/GMT+5` == `UTC-5`. This is a particular quirk of the IANA time zone names of the form `ETC/GMT*`. See https://github.com/eggert/tz/blob/2018i/etcetera#L38-L44 – Matt Johnson-Pint Feb 08 '19 at 20:02
  • DTSTART;TZID=GMT-0500:20181213T190000 DTEND;TZID=GMT-0500:20181213T220000, These are from ics returned by caldav server for icloud for some user's event. I know GMT-5 is equivalent to Etc/GMT-5. When I created event in America/Toronto on icloud.com it gave Canda/Eastern in ics which works fine. I have already check list of IANA timezones and I found that icloud.com returns some different timezones also like in format of GMT/+ and GMT/-, so for these cases when ics is parsed is doesn't updates AsUtc flag correctly.As these strings are returned by caldav server so,I don't have control overt it. – Priyank Kotiyal Feb 09 '19 at 17:09