#include <time.h>
#include <stdio.h>

int main(int argc, char **argv)
{
   long int mstinsec, timeinsec, gmtinsec;

   long int mininhour = 60;
   long int secinhour = 3600;

   tzset();

   mstinsec  = timezone;
   timeinsec = time(NULL);
   gmtinsec  = timeinsec - mstinsec;

   printf("local timezone: %s\n", tzname[0]);

   printf("%s = %ld hours, %ld minutes, or %ld seconds from GMT\n\n", 
          tzname[0], mstinsec / secinhour, mstinsec / mininhour, mstinsec);

   printf("local time(): %ld, GMT time() = %ld\n", timeinsec, gmtinsec);

   return 0;
}
