gtime.h 431 B

1234567891011121314151617181920212223
  1. #ifndef _G_Time_H__
  2. #define _G_Time_H__
  3. #include "os/os_type.h"
  4. typedef struct{
  5. uint16_t year; /*YYYY*/
  6. uint8_t month;
  7. uint8_t day;
  8. uint8_t hour;
  9. uint8_t minute;
  10. uint8_t second;
  11. }time_val;
  12. uint32_t calendar_to_utc(time_val *time);
  13. void set_utc_time(time_val *time);
  14. void get_local_time(time_val *out, int8_t tz);
  15. uint32_t get_timestamp(void);
  16. uint32_t get_timestamp_with_time_zone(int8_t tz);
  17. #endif /* _G_Time_H__ */