[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: working patch for time offset calculation



"Daniel Wasserhaus" <notgordan@gmail.com> wrote:

> Hi,
>
> I just looked through the latest cdrtools-2.01.01a24 release to see if
> Jörg has applied my patch for the timezone calculation. Well, he's
> using a different way to calculate the timezone offset now:
>
> local.tm_min -= gmt.tm_min;
> local.tm_hour -= gmt.tm_hour;
> local.tm_yday -= gmt.tm_yday;
> if (local.tm_yday < -2) /* Hit new-year limit */
>   local.tm_yday = 1; /* Local is GMT + 1 day */
> iso_time[16] = (local.tm_min + 60 *
>   (local.tm_hour + 24 * local.tm_yday)) / 15;
>
> But this only works for those east of greenwich! If you are in a tz
> behind GMT/UTC, like the USA, the if expression never catches
> (local.tm_yday would be > 2 when local.tm_year != gmt.tm_year). I must
> admit though, that my posted patch with the following calculation:

Please provide test data that proves that my patch does not work.
I did test is with many offsets and it seem to work.

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       schilling@fokus.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily



Reply to: