You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef _TIME_H
  2. #define _TIME_H
  3. /** @file
  4. *
  5. * Date and time
  6. */
  7. #include <sys/time.h>
  8. #include <ipxe/time.h>
  9. /** Broken-down time */
  10. struct tm {
  11. /** Seconds [0,60] */
  12. int tm_sec;
  13. /** Minutes [0,59] */
  14. int tm_min;
  15. /** Hour [0,23] */
  16. int tm_hour;
  17. /** Day of month [1,31] */
  18. int tm_mday;
  19. /** Month of year [0,11] */
  20. int tm_mon;
  21. /** Years since 1900 */
  22. int tm_year;
  23. /** Day of week [0,6] (Sunday=0) */
  24. int tm_wday;
  25. /** Day of year [0,365] */
  26. int tm_yday;
  27. /** Daylight savings flag */
  28. int tm_isdst;
  29. };
  30. /**
  31. * Get current time in seconds since the Epoch
  32. *
  33. * @v t Time to fill in, or NULL
  34. * @ret time Current time
  35. */
  36. static inline time_t time ( time_t *t ) {
  37. time_t now;
  38. now = time_now();
  39. if ( t )
  40. *t = now;
  41. return now;
  42. }
  43. extern time_t mktime ( struct tm *tm );
  44. #endif /* _TIME_H */