Events shifted 1 hour with cPanel and Hong Kong Time



  • (Split from https://forums.bitfire.at/topic/1721/calendar-event-times-shifted/)

    I have the same problem, event time shifted by one hour earlier for every event created in Android.

    Events created in other platforms and sync to Android are correct.



  • @rfc2822
    I figured out the time shift of 1 hour occurred with the "Hong Kong" time zone. If I use China or Singapore time zone which are all GMT+8, the time will not shift.

    Please see whether you can reproduce the problem with Hong Kong time zone. The server is Cpanel.

    Thanks.


  • developer

    @andrew Seems to be a server thing. When creating an event for 15 Apr 2018 18:30:00 (Hong Kong), DAVdroid sends this event to the server:

    BEGIN:VEVENT
    DTSTAMP:20180415T101259Z
    UID:1961cf67-bd19-4be9-abaf-8ab6e4aa7d7b
    SUMMARY:Test
    DTSTART;TZID=Asia/Hong_Kong:20180415T183000
    DTEND;TZID=Asia/Hong_Kong:20180415T193000
    STATUS:CONFIRMED
    END:VEVENT
    BEGIN:VTIMEZONE
    TZID:Asia/Hong_Kong
    TZURL:http://tzurl.org/zoneinfo/Asia/Hong_Kong
    X-LIC-LOCATION:Asia/Hong_Kong
    BEGIN:STANDARD
    TZOFFSETFROM:+073642
    TZOFFSETTO:+0800
    TZNAME:HKT
    DTSTART:19041030T000000
    RDATE:19041030T000000
    END:STANDARD
    BEGIN:DAYLIGHT
    TZOFFSETFROM:+0800
    TZOFFSETTO:+0900
    TZNAME:HKST
    DTSTART:19410401T033000
    RDATE:19410401T033000
    RDATE:19460420T033000
    RDATE:19470413T033000
    RDATE:19480502T033000
    RDATE:19490403T033000
    RDATE:19500402T033000
    RDATE:19510401T033000
    RDATE:19520406T033000
    RDATE:19530405T033000
    RDATE:19540321T033000
    RDATE:19550320T033000
    RDATE:19560318T033000
    RDATE:19570324T033000
    RDATE:19580323T033000
    RDATE:19590322T033000
    RDATE:19600320T033000
    RDATE:19610319T033000
    RDATE:19620318T033000
    RDATE:19630324T033000
    RDATE:19640322T033000
    RDATE:19650418T033000
    RDATE:19660417T033000
    RDATE:19670416T033000
    RDATE:19680421T033000
    RDATE:19690420T033000
    RDATE:19700419T033000
    RDATE:19710418T033000
    RDATE:19720416T033000
    RDATE:19730422T033000
    RDATE:19731230T033000
    RDATE:19750420T033000
    RDATE:19760418T033000
    RDATE:19790513T033000
    END:DAYLIGHT
    BEGIN:STANDARD
    TZOFFSETFROM:+0900
    TZOFFSETTO:+0800
    TZNAME:HKT
    DTSTART:19410930T033000
    RDATE:19410930T033000
    RDATE:19450915T000000
    RDATE:19461201T033000
    RDATE:19471230T033000
    RDATE:19481031T033000
    RDATE:19491030T033000
    RDATE:19501029T033000
    RDATE:19511028T033000
    RDATE:19521025T033000
    RDATE:19531101T033000
    RDATE:19541031T033000
    RDATE:19551106T033000
    RDATE:19561104T033000
    RDATE:19571103T033000
    RDATE:19581102T033000
    RDATE:19591101T033000
    RDATE:19601106T033000
    RDATE:19611105T033000
    RDATE:19621104T033000
    RDATE:19631103T033000
    RDATE:19641101T033000
    RDATE:19651017T033000
    RDATE:19661016T033000
    RDATE:19671022T033000
    RDATE:19681020T033000
    RDATE:19691019T033000
    RDATE:19701018T033000
    RDATE:19711017T033000
    RDATE:19721022T033000
    RDATE:19731021T033000
    RDATE:19741020T033000
    RDATE:19751019T033000
    RDATE:19761017T033000
    RDATE:19791021T033000
    END:STANDARD
    BEGIN:STANDARD
    TZOFFSETFROM:+0800
    TZOFFSETTO:+0900
    TZNAME:JST
    DTSTART:19411225T000000
    RDATE:19411225T000000
    END:STANDARD
    BEGIN:DAYLIGHT
    TZOFFSETFROM:+0900
    TZOFFSETTO:+0900
    TZNAME:HKST
    DTSTART:19740421T033000
    RDATE:19740421T033000
    END:DAYLIGHT
    END:VTIMEZONE
    

    The DST definitions are until 1979 only (when the DST has been eliminated in Hong Kong Time). So the given offset is +0800, so DTSTART;TZID=Asia/Hong_Kong:20180415T183000 is equivalent to 20180415T103000Z (10:30 UTC).

    However, the server immediately rewrites the event to

    BEGIN:VEVENT
    DTSTART:20180415T093000Z
    DTEND:20180415T103000Z
    DTSTAMP:20180415T101313Z
    UID:1961cf67-bd19-4be9-abaf-8ab6e4aa7d7b
    CREATED:20180415T101259Z
    LAST-MODIFIED:20180415T101259Z
    SUMMARY:Test
    CLASS:PUBLIC
    STATUS:CONFIRMED
    TRANSP:OPAQUE
    END:VEVENT
    

    As you can see, the server uses DTSTART:20180415T093000Z which is

    1. without time zone information,
    2. at 9:30 UTC instead of 10:30 UTC.

    See also https://bugs.horde.org/ticket/13866 (cPanel is using Horde, as far as I know).

    Can you please report this to cPanel (guess it would be good to provide a link to this thread) and share the report URL here for tracking?



  • @rfc2822 thanks for the troubleshooting.

    I will report to cPanel, possibly via my hosting service provider, and keep everyone posted on the progress.



  • Did the APK that rfc2822 sent you help the problem?



  • @executive said in Events shifted 1 hour with cPanel and Hong Kong Time:

    Did the APK that rfc2822 sent you help the problem?

    No, the problem still persists with that APK.



  • @andrew said in Events shifted 1 hour with cPanel and Hong Kong Time:

    @rfc2822 thanks for the troubleshooting.

    I will report to cPanel, possibly via my hosting service provider, and keep everyone posted on the progress.

    The following is the update from the hosting service provider.
    Dear customer,

    According to cPanel reply, the issues was relate to Horde:
    https://bugs.horde.org/ticket/13866

    Once Horde have resolve the issues, cPanel will including the fix in next cPanel update.

    You may consider to add the event at webmail for now.

    Thank you.