Recurring events with timezone

Hendrik Helwich h.helwich at tarent.de
Wed Oct 27 16:50:25 CEST 2010



Am Mittwoch, 27 Oktober 2010 16:12:03 schrieb Tobias König:
> On Wednesday 27 October 2010 12:24:10 Hendrik Helwich wrote:
> > Am Donnerstag, 21 Oktober 2010 15:52:12 schrieb Tobias König:
> >
> > Hi Tobias,
>
> Hej Hendrik,
>

Hi Tobias,

> > To do this you must know in which tz this event should happen to know
> > which DST rules should be applied.
>
> No, you only need to know when this event was created and what the DST
> rules of your local (or the one you want to see the event in) timezone are.
> Everything else can be calculated with these two information.

No, if you take the local DST rules (which could be different depending on the 
system tz of the users) you will get different UTC times. This is wrong i 
think.
Example: if i have a local german tz and i create a recurring event from today 
which starts at 16:00 every day, in the kolab format there is a startdate of 
14:00 UTC stored (current DST offset of 2 hours) and the rule to repeat this 
event every day. Kontact/Toltec show me a start date of this event of 16:00 
even if UTC offset changes due to the local DST rules in the next month.
If i have my system tz set to South Africa/johannesburg and create the same 
event then it is saved the same UTC time (same UTC offset there at the 
moment) and it is also always shown 16:00 on every day.
So in this example the storage xml is the same and the shown local times in 
the clients are the same.
But this is obviously wrong because both tzs have different DST rules and the 
same kolab event is shown the same in the clients all the year.
This is because of trying to fix the format by applying local DST rules to get 
the UTC time.

> > If you use the system local tz DST rules like it is implemented right now
> > in the clients, people in different tzs would use different rules and the
> > UTC times could be different for the same event.
>
> Not if they do the calculation correctly. Currently they just do a
>   'UTC + offset -> localtime'
> where 'offset' is a fixed number depending on the DST. While this works for
> single events, it is the problem for recurring events.
> So in the latter case, clients have to calculate the 'offset' depending on
> the DST _and_ the point in time when the event has been created.
>
> If clients don't do this, it's a bug in the clients but not a limitation of
> the format.

No, the clients need the information of the DST rules of the events tz. 
Otherwise it is not possible to calculate the correct UTC times of the dates.
Applying local DST rules is not correct because they are different on every 
client and lead to different UTC times.

> > You need to convert the start time like
> > event tz -> UTC -> client tz
>
> No, there is no event tz, events are always stored in UTC.

Yes this is right. But the problem is that it is done wrong in the moment, so 
one solution would be to calculate UTC -> local correct or another solution 
would be to add event tz to the kolab format and calculate
event tz -> UTC -> client tz

Best Regards

Hendrik

> Ciao,
> Tobias




More information about the format mailing list