Sync with ownCloud makes 2 hours late

Support related problems and questions

Moderators: Max, TerryRogers

Post Reply
mvg
Novice
Posts: 14
Joined: Thu Apr 18, 2013 1:02 pm

Sync with ownCloud makes 2 hours late

Post by mvg »

Hi,

I´m trying to use EssentialPIMProPortable to check if this will syncronise my PC, Laptop an Android-Smartphone with my own ownCloud-server.

If I sync from Portable to ownCloud, all dates are two hours later (ex. 11.30 am instead of 9:30 am).


Michael
Max
Site Admin
Posts: 21714
Joined: Wed Dec 08, 2004 11:39 pm
Has thanked: 819 times
Been thanked: 364 times
Contact:

Re: Sync with ownCloud makes 2 hours late

Post by Max »

Hello,
if it is a public service, please tell its name. If not, please tell owncloud version number.
Maxim,
EPIM Team
mvg
Novice
Posts: 14
Joined: Thu Apr 18, 2013 1:02 pm

Re: Sync with ownCloud makes 2 hours late

Post by mvg »

It´s not public. There is ownCloud 5.0.3 installed.
Nurgotora
Guru
Posts: 238
Joined: Wed May 29, 2013 3:54 pm
Has thanked: 4 times
Been thanked: 15 times

Re: Sync with ownCloud makes 2 hours late

Post by Nurgotora »

It's an OwnCloud-bug (-error, -anomaly, ..., tested with version 5.0.6): (1) The data sent by EssentialPIM 5.54 with CalDAV is correct. (2) All entries in OwnCloud's database are correct. (3) Only the display in the OwnCloud's calendar is wrong. (4) Even the Edit-Dialog of OwnCloud's calendar shows the correct time. Educated guess: OwnCloud has some bug involving time zones (2 hours hint at GMT vs CEST) in the display routines.
Nurgotora
Guru
Posts: 238
Joined: Wed May 29, 2013 3:54 pm
Has thanked: 4 times
Been thanked: 15 times

Re: Sync with ownCloud makes 2 hours late

Post by Nurgotora »

Part 1: Ok, I've to correct myself :shock: - and hate to do it ;-)

OwnCloud stores all time in UTC (formerly known as GMT). For display in the webinterface, the time is adjusted to the currently set timezone (see attachment). So, e.g. if we're in Brussels, Belgium, (and have configured that in Owncloud) we have CET with daylight saving time (CEST) and are therefore UTC+02:00.

An event at 21:00 CEST is therefore stored as 19:00 in the database:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:ownCloud Calendar
BEGIN:VEVENT
CREATED;VALUE=DATE-TIME:20130612T110732Z
UID:573d744eb4
LAST-MODIFIED;VALUE=DATE-TIME:20130612T110732Z
DTSTAMP;VALUE=DATE-TIME:20130612T110732Z
SUMMARY:Test3
DTSTART;VALUE=DATE-TIME:20130612T190000Z
DTEND;VALUE=DATE-TIME:20130612T193000Z
CLASS:PUBLIC
END:VEVENT
END:VCALENDAR

and shown as 21:00 in the Calendar. If you change the timezone to London (in the summer it's UTC+01:00), the event will show (after you've reloaded the calendar-page) at 20:00.

Part 2: And now for EssentialPIM -> CalDAV -> Owncloud and the magically added 2 hours: In fact a bug in EssentialPIM

EssentialPIM transmits the time as it has it (21:00):
"DTSTART:20130612T210000"
and wrongly does not make use of one of the two methods specified in rfc2445, section-4.2.19:
A) Either transmit UTC (EssentialPIM should, in our case, substract -02:00 from 21:00)
B) or include the TZID-parameter ("DTSTART;TZID=CENTRAL-EUROPE:20130612T210000")
OwnCloud therefore interpretes the time as UTC, stores it as such in the database and shows, in our example, corrected for UTC+02:00): 23:00

Part 3: The ominous "Z" at the end of the "DTSTART;VALUE=DATE-TIME:20130612T190000Z"
see: rfc2445, section-4.3.5
As mvg an I have noted, the edit-dialog of OwnCloud's calendar shows (for events coming from EssentialPIM) the time stored in the database (21:00), even so the Calender itself shows 23:00. This is because EssentialPIM transmits the time in the form "DTSTART:20130612T210000" (without that "Z" at the end). If EssentialPIM would add that "Z" at the end, both calendar and its edit-dialog would (correctly) show "23:00".

Conclusion
EssentialPIM should transmit UTC in all CalDAV (and probably CardDAV, too) data in the form

DTSTART;VALUE=DATE-TIME:20130612T190000Z

Note for the developers: This is probably much easier and more reliable, as the TZID is not only specified rather complicated in rfc2445 but also tied to an even more complicately specified "VTIMEZONE" calendar component...

It would be great if this could make it into 5.55 ;-) ;-)

===============================
Attachments
OwnCloudTimeZone.jpg
OwnCloudTimeZone.jpg (37.44 KiB) Viewed 3769 times
Nurgotora
Guru
Posts: 238
Joined: Wed May 29, 2013 3:54 pm
Has thanked: 4 times
Been thanked: 15 times

Fixed in 5.55

Post by Nurgotora »

Cool,

as I can just saw (while checking Umlaute and line breaks in CalDav), this has been fixed. An 18:00 to 18:30 (CEST) event is now transmitted (16:00-16:30) UTC with the 'Z' at the end:

BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
BEGIN:VEVENT
SUMMARY:Test 3
DTEND:20130614T163000Z
DTSTART:20130614T160000Z
DTSTAMP:20130614T123246
UID:20130614T123246707521.ics
SEQUENCE:1
END:VEVENT
END:VCALENDAR

Fine!
Max
Site Admin
Posts: 21714
Joined: Wed Dec 08, 2004 11:39 pm
Has thanked: 819 times
Been thanked: 364 times
Contact:

Re: Sync with ownCloud makes 2 hours late

Post by Max »

mvg, can you confirm it is fixed in 5.55?
Maxim,
EPIM Team
Post Reply