Advertisement
Guest User

Untitled

a guest
Nov 27th, 2015
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #include <stdint.h>
  2.  
  3. /*
  4. * A base date structure that can easily represent any date necessary (in the Gregorian calendar).
  5. */
  6.  
  7. typedef struct sCDate {
  8. uint16_t year;
  9. unsigned year_sign : 1;
  10. unsigned month : 4;
  11. unsigned mday : 5;
  12. unsigned hour : 5;
  13. unsigned min : 6;
  14. unsigned sec : 6;
  15. signed offset : 5;
  16. unsigned _padding : 16; // to align unexpanded date to int boundary
  17. } CDate;
  18.  
  19. typedef struct sXCDate {
  20. uint32_t year;
  21. unsigned year_sign : 1;
  22. unsigned month : 4;
  23. unsigned mday : 5;
  24. unsigned hour : 5;
  25. unsigned min : 6;
  26. unsigned sec : 6;
  27. signed offset : 5;
  28. } XCDate;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement