On Mon, 17 Oct 2011 11:11:48 -0500, Shmuel Metz (Seymour J.) wrote:
> on 10/16/2011 at 03:15 PM, Paul Gilmartin said:
>
>>It never "switch[es]".
>
>How do you define switch.
>
To perform semiannually some particular action which (only) some OSes
require to accommodate the Daylight Time changes, such as
o Issuing a command (manually or by MGCR) to set the local time
o (Re)setting the system clock.
o IPLing to set the system clock.
o Shutting down for an hour to accommodate such changes.
The need to do such things is not Divinely ordained; it's merely
a misconception of people whose minds have been warped by
excessive exclusive exposure to Windows and/or MVS.
>>TZ specifies a formula for converting system clock
>>values to civil time values.
>
>That formula includes start and stop dates.
>
Yes.
>>That formula will be exactly the same a month
>>from today as it is today.
>
>The formula
>
>TZ=EST5EDT,3,2,0,7200,11,1,0,7200,3600
>
ITYM TZ=EST5EDT,M3.2.0/02:00:00,M11.1.0/02:00:0
>will not change. The output for a given input, however, will change. I
>call that a switch.
>
It will not change.
>>Given identical inputs, it will yield identical
>>outputs next month as now.
>
>Not unless you ignore everything after the first field.
>
I'm incredulous. I wrote the following test program:
user@MVS:138$ cat ../source/timepair.c
/* Doc: investigate behavior of time conversion functions for
identical time zone settings and inputs before and after
the Daylight Time change.
*/
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include <string.h>
#define ZONE "EST5EDT,M3.2.0/02:00:00,M11.1.0/02:00:00"
void ShowIt( time_t secs ) {
struct tm L;
char s[ 100 ];
strftime( s, 99, "%Y %b-%d %T %Z", localtime( &secs ) );
printf("%s\n", s ); }
int main( void ) {
char *tz=malloc( strlen( ZONE ) + 4 );
strcpy( tz, "TZ=" );
putenv( strcat( tz, ZONE ) );
ShowIt( 1318800000 ); /* Sometime in October, 2011. */
ShowIt( 1318800000 + 31 * 86400 ); /* One month later. */
}
Which produces the output:
user@MVS:139$ ./timepair
2011 Oct-16 17:20:00 EDT
2011 Nov-16 16:20:00 EST
I'm confident that next month, with Daylight Time no longer in effect, it will
produce identical outputs given the same inputs ( 1318800000 and
1318800000 + 31 * 86400 );
If you believe otherwise, I'll run it again next month to verify.
-- gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html