localtime.c 298 B

123456789101112131415161718192021
  1. #include <time.h>
  2. extern void __tm_conv();
  3. struct tm *localtime(timep)
  4. __const time_t *timep;
  5. {
  6. static struct tm tmb;
  7. struct timezone tz;
  8. time_t offt;
  9. gettimeofday((void *) 0, &tz);
  10. offt = -tz.tz_minuteswest * 60L;
  11. /* tmb.tm_isdst = ? */
  12. __tm_conv(&tmb, timep, offt);
  13. return &tmb;
  14. }