tzset

Sets the tzname, timezone, and daylight global variable parameters

Local Servers:nonblocking
Remote Servers:N/A
Classification:Other
Service:Time/Date Manipulation

Syntax

  #include <time.h>  
   
  void tzset  (void);
  

Return Values

None

Remarks

Before accessing the tzname, timezone, and daylight global variable parameters, you must first call tzset to initialize or update these variables to the correct values.

CLIB.NLM uses the time zone information that is set by issuing the SET TIMEZONE (also SET TIME ZONE) console command.

For NetWare 3.x, tzset always uses the time zone information that is active when CLIB.NLM loads. If the SET TIMEZONE command is issued after CLIB.NLM loads, tzset does not use the updated information. Therefore, for NetWare 3.x, the SET TIMEZONE command must be issued in the following prescribed order:

At the server console, issue the SET TIMEZONE command with the time zone name, hours, and daylight savings code parameters.

Load CLIB.NLM.

Load your NLM application.

Refer to the Supervising the Network manual for more information on the SET TIMEZONE command.

In NetWare 4.x, tzset uses the current time zone setting of the server to initialize or update the values of the tzname, timezone, and daylight global variable parameters. However, remember that these variables will not be automatically updated when the SET TIMEZONE command is issued. They are updated only when tzset is called. For this reason, you should call tzset before calling any of the time functions. Doing so ensures that the tzname, timezone, and daylight global variable parameters contain the proper values.

See Also

asctime, asctime_r, gmtime, gmtime_r, localtime, localtime_r, time

Example

  #include <time.h> 
  #include <nwtime.h> 
  #include <stdio.h>  
   
  void print_zone()  
  {  
     tzset(); 
      
     printf( "time zone names: %s %s\ n", tzname[0], tzname[1]);  
     printf( "timezone: %ld \ n", timezone ) ;  
     printf( "daylight: %d\n", daylight ) ;  
  }
  

produces the following:

     time zone names: PST PDT  
     timezone: 28800  
     daylight: 1