Arne Wörner wrote in
<[email protected]>:
|On 2022-08-01T15:02:29TAI, Steffen Nurpmeso wrote:
|> And localtime(3), on Linux, usually works according to /etc/localtime.
|>
|And localtime() fills a struct tm,
|which has tm_gmtoff,
|which contains fractions of a minute in my case (tm_gmtoff%60 equals \
|37 currently),
|which RFC5322 cannot represent,
|because it does not want to show the GMT offset accurately enough...
|
|example:
|% cat a.c
|#include <time.h>
|#include <stdio.h>
|
|int main() {
| time_t now = time(0);
| struct tm * t;
| t = localtime(&now);
| printf("localtime: gmtoff:%d gmtoff%60:%d\n", t->tm_gmtoff, t->tm_gmtoff\
| %60);
| t = gmtime(&now);
| printf("gmtime: gmtoff:%d gmtoff%60:%d\n", t->tm_gmtoff, t->tm_gmtoff%60);
| return 0;
|}
|% c++ -o a a.c -O3
|% ./a
|localtime: gmtoff:37 gmtoff%60:37
|gmtime: gmtoff:0 gmtoff%60:0
|
|> How should i detect this?
|>
|U could check if gmtoff%60 is non-zero after a localtime() call,
|and
|if yes, then u switch to gmtime, which should do the trick.
|
|> So then. And exim fits that perfect environment?
|>
|exim handles this situation properly now, I think...
|https://bugs.exim.org/show_bug.cgi?id=2530
So why don't you come over with something understandable directly.
What has %60 to do with it?
So what you made the exim people do is that you force
interpretation of the local time as UTC if local seconds and UTC
seconds differ? But this is surely wrong, since any timezone can
do so potentially!
$ grep -E '[[:digit:]+:[[:digit:]]+:[[:digit:]]+' \
/usr/share/zoneinfo/tzdata.zi | wc -l
624
???
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)