Re: [PLUG] Question on mktime() results - not the unset TZ variable causing the problem

2016-01-27 Thread Russell Senior
> Steve: > Same result, so it's not the TZ environmental variable. > > #include > #include > #include > #include > > int main() { > > char pacific_timezone[8] = "PST8PDT"; > char * timezone =_timezone[0]; > > // Date: November 18, 1883 12:07:01 am PST > > struct tm

Re: [PLUG] Question on mktime() results

2016-01-26 Thread Russell Senior
> "logical" == logical american writes: logical> That is the $64,000 question, I want to know why the gcc logical> compiler changed the timezone to LMT on its own. I'm guessing it's an artifact of glibc's mktime() implementation. I'd suggest looking that the

Re: [PLUG] Question on mktime() results

2016-01-26 Thread Russell Senior
> "Russell" == Russell Senior writes: > "logical" == logical american writes: logical> That is the $64,000 question, I want to know why the gcc logical> compiler changed the timezone to LMT on its own. Russell> I'm guessing it's an

Re: [PLUG] Question on mktime() results

2016-01-26 Thread Steve Dum
It appears to be garbage in - garbage out, via a very obscure route. If you start off with TZ=PST8PDT export TZ call your program then you get consistent results, with the tm_zone portion of the struct set to PDT in both cases. the man page for mktime doesn't indicate that the tm_gmtoff and

Re: [PLUG] Question on mktime() results - not the unset TZ variable causing the problem

2016-01-26 Thread logical american
Steve: Same result, so it's not the TZ environmental variable. #include #include #include #include int main() { char pacific_timezone[8] = "PST8PDT"; char * timezone =_timezone[0]; // Date: November 18, 1883 12:07:01 am PST struct tm first_tm;

Re: [PLUG] Question on mktime() results

2016-01-26 Thread logical american
> galens@lion:~$ make mktime_test > cc mktime_test.c -o mktime_test > galens@lion:~$ ./mktime_test > first struct tm object dump: 1 7 12 18 10 -17 0 321 0 -28378 LMT > second struct tm object dump: 2 7 12 18 10 -17 0 321 0 -28800 PST > First time tick: -2717640001 Second time tick:

Re: [PLUG] Question on mktime() results

2016-01-26 Thread logical american
On 1/26/2016 4:49 AM, David Barr wrote: > I will quite happily play the straight man, here: why are `gmtoff` and `zone` > different in `first_tm` vs `second_tm`? > > David That is the $64,000 question, I want to know why the gcc compiler changed the timezone to LMT on its own.

Re: [PLUG] Question on mktime() results

2016-01-26 Thread David Barr
I will quite happily play the straight man, here: why are `gmtoff` and `zone` different in `first_tm` vs `second_tm`? David > On Jan 25, 2016, at 20:57, Galen Seitz wrote: > > On 01/25/16 17:23, logical american wrote: >> To C geeks: >> >> Could someone who has

Re: [PLUG] Question on mktime() results

2016-01-25 Thread Galen Seitz
On 01/25/16 20:57, Galen Seitz wrote: > On 01/25/16 17:23, logical american wrote: >> To C geeks: >> >> Could someone who has freetime on their linux system compile the >> following C program and see if they can duplicate these results? >> I found a strange 422 second difference between the 2

[PLUG] Question on mktime() results

2016-01-25 Thread logical american
To C geeks: Could someone who has freetime on their linux system compile the following C program and see if they can duplicate these results? I found a strange 422 second difference between the 2 times. mktime-discrepancy.c - #include #include #include