time.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef _SYS_TIME_H_
  2. #define _SYS_TIME_H_
  3. #include <sys/types.h>
  4. /*
  5. * Structure returned by gettimeofday(2) system call,
  6. * and used in other calls.
  7. */
  8. struct timeval {
  9. long tv_sec; /* seconds */
  10. long tv_usec; /* and microseconds */
  11. };
  12. /*
  13. * Structure defined by POSIX.1b to be like a timeval.
  14. */
  15. struct timespec {
  16. time_t tv_sec; /* seconds */
  17. long tv_nsec; /* and nanoseconds */
  18. };
  19. struct timezone {
  20. int tz_minuteswest; /* minutes west of Greenwich */
  21. int tz_dsttime; /* type of dst correction */
  22. };
  23. struct tm {
  24. int tm_sec; /* Seconds. [0-60] (1 leap second) */
  25. int tm_min; /* Minutes. [0-59] */
  26. int tm_hour; /* Hours. [0-23] */
  27. int tm_mday; /* Day. [1-31] */
  28. int tm_mon; /* Month. [0-11] */
  29. int tm_year; /* Year - 1900. */
  30. int tm_wday; /* Day of week. [0-6] */
  31. int tm_yday; /* Days in year.[0-365] */
  32. int tm_isdst; /* DST. [-1/0/1]*/
  33. long int tm_gmtoff; /* Seconds east of UTC. */
  34. const char *tm_zone; /* Timezone abbreviation. */
  35. };
  36. #endif