code_junkie

Seen this binary date format?

Nov 12th, 2011
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. 1822392319 = 0x6c9f7fff
  2. 0x6c = 108 = 2008 (based on 1900 start date)
  3. 0x9 = 9 = September
  4. 0xf7fff - take top 5 bits = 0x1e = 30
  5.  
  6. 1822490623 = 0x6ca0ffff
  7. 0x6c = 108 = 2008
  8. 0xa = 10 = October
  9. 0x0ffff - take top 5 bits = 0x01 = 1
  10.  
  11. day_of_month = (value >> 15) & 0x1f
  12.  
  13. year = (value >> 24) & 0xff + 1900
  14. month = (value >> 20) & 0x0f
  15.  
  16. a = 1822556159
  17. 1101100 1010 00011 111111111111111
  18. b = 1822523391
  19. 1101100 1010 00010 111111111111111
  20. c = 1822490623
  21. 1101100 1010 00001 111111111111111
  22. d = 1822392319
  23. 1101100 1001 11110 111111111111111
Add Comment
Please, Sign In to add comment