24 lines
461 B
C
24 lines
461 B
C
#include <stdio.h>
|
|
#include <env.h>
|
|
#include <time.h>
|
|
|
|
void print_zone()
|
|
{
|
|
char *tz;
|
|
|
|
printf( "TZ: %s\n", (tz = getenv( "TZ" ))
|
|
? tz : "default EST5EDT" );
|
|
printf( " daylight: %d\n", daylight );
|
|
printf( " timezone: %ld\n", timezone );
|
|
printf( " time zone names: %s %s\n",
|
|
tzname[0], tzname[1] );
|
|
}
|
|
|
|
void main()
|
|
{
|
|
print_zone();
|
|
setenv( "TZ", "PST8PDT", 1 );
|
|
tzset();
|
|
print_zone();
|
|
}
|