Re: zogi and daylight savings

Adam Tauno Williams <[email protected]> Tue, 25 Aug 2009 11:29:49 -0400
Newsgroups gmane.comp.cms.opengroupware.xmlrpc.devel
Message-ID <1251214189.5123.5.camel@linux-m3mt>
On Mon, 2009-06-15 at 11:27 +0200, Tobias Kaefer wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> On Mon Jun 08 2009 19:14:53 GMT+0200 (CEST), Adam Tauno WIlliams wrote:
> > <quote>
> >   /* if we successfuly aquired a date then make an adjustment to
> >      GMT if a timezone was provided;  GMT values are not changed. */
> >   if ([dateValue isNotNull]) {
> >     zoneDiff = [timeZone secondsFromGMTForDate:dateValue];
> >     if (zoneDiff != 0) {
> >       dateValue = [dateValue dateByAddingYears:0
> >                                         months:0
> >                                           days:0
> >                                          hours:0
> >                                        minutes:0
> >                                        seconds:(zoneDiff * -1)];
> >   [dateValue setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"GMT"]];
> >   return dateValue;
> > </quote>
> After knowing where to do some patching, the issue is very easy to
> solve. I provided a patch for that (see
> http://code.google.com/p/zogi/issues/detail?id=33#c5).
> It's basically just this:
> <quote>
> dateValue = [NSCalendarDate dateWithYear:[dateValue yearOfCommonEra]
>                                month:[dateValue monthOfYear]
>                                day:[dateValue dayOfMonth]
>                                hour:[dateValue hourOfDay]
>                                minute:[dateValue minuteOfHour]
>                                second:[dateValue secondOfMinute]
>                                timeZone:timeZone];
> </quote>

How has this patch been working out for you? Any unforseen side effects?

> Maybe to much overhead, with createing a new NSCalendarDate-Object.

It is OK with me;  groupware is massively read-oriented and this only
effects the write path.

-- 
OpenGroupware.org XML-RPC
[email protected]
http://mail.opengroupware.org/mailman/listinfo/xmlrpc