On Fri, Oct 21, 2011 at 3:31 AM, Peter Samuelson <[email protected]> wrote:
>
> Package: swaks
> Version: 20100211.0-4
> Tags: patch
>
> The timezone field of RFC 822 date format is [+-]HHMM, whereas swaks
> calculates it as hundredths-of-an-hour.  So it is wrong any time the MM
> field is nonzero.  For example:
>
> Timezone             RFC822   swaks
> -----------------------------------
> Canada/Newfoundland   -0230   -0250
> Asia/Tehran           +0330   +0350
> Asia/Kathmandu        +0545   +0575
> Australia/Eucla       +0845   +0875
>
> Peter
>
>
> --- swaks
> +++ swaks
> @@ -1946,7 +1946,8 @@
>     @l = gmtime($et);
>   } else {
>     my @g = gmtime($et);
> -    $o = (timelocal(@l) - timelocal(@g))/36;
> +    $o = (timelocal(@l) - timelocal(@g))/60;
> +    $o = int($o / 60)*100 + ($o%60)*($o > 0 ? 1 : -1);
>   }
>   $G::date_string = sprintf("%s, %02d %s %d %02d:%02d:%02d %+05d",
>                  (qw(Sun Mon Tue Wed Thu Fri Sat))[$l[6]],
>

Now that's just embarrassing...  Thanks for catching this issue and
providing the patch.  I just checked it into my repo.  I have to say
that's a nice patch - I was sure I could make it simpler, but there
are a lot of fiddly edge cases, I couldn't get anything simpler.  Nice
job =).

--John



--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to