forget doing it with code for now, we can come back to that after, first help me do it manually, my result is wrong...
working:
timestamp returned from the file i'm working on is:BUT that cannot be correct!!!
29851110, -1418797106
1) -1418797106 is not the true decimal representation of the second half because bit 32 was taken as a negative in twos's compliment! to get the real positive value from the negative value...
lowest part of the range for a 32bit 2's compliment number = -2147483648
so whats the difference between that and our number? because that will give us the true decimal representation of its 1 to 31.
-2147483648 - -1418797106 = 2147483648 - 1418797106 = 728686542
now take the 32nd bit as a positive value = 2147483648
now add bits 32 and 1->31 together: 2147483648 + 728686542 = 2876170190
so the true decimal value for the second half is:
*****************
2876170190
*****************
2) 29851110 is not the true representation of the first half because the wrong unit column headings were used to convert it to decimal. so to get the true value we do what?
if we have 111 (7 base10), pretend those represent bits 9,10,11 in a larger binary number (i.e. columns 256, 512, 1024), it's really 1792 base10.
1792 / 7 = 256, so we see that we could have just multiplied the value by the value of the first true unit column: 7 * 256 = 1792.
so 29851110 * 4294967296 =
*******************
128209541199298560
*******************
3) now, if we add #2 (decimal of bits 33-64) and #1 (decimal of bits 1-32) together we get:
128209541199298560 + 2876170190 =
###################
128209544075468750
###################
4) now, this value 128209544075468750 should represent:
"the number of 100 nanosecond intervals since the unix epoch"
to convert to seconds apparently we divide by 10,000,000
128209544075468750 / 10000000 =
####################
12820954407.5468750
####################
using the date() and mktime() functions in PHP with the last modified date of that file (13 April 2007, 17:13:27), i get 1178400480
PHP is giving me a ten digit number beginning 117
this is giving me an eleven digit number beginning 128
so what the hell am i doing wrong........... 😠