php and reading a quadword
Posted: Sun Jul 11, 2010 2:03 pm
Greetings
Im working on a project that involves reading a file generated on another platform (OpenVMS running on Itanium). The file stores a date in a Quadword, according to the file documentation I have. The file spec docs do not specify the date format, but I did find documentation for how OpenVMS stores dates... the number of 100 nanosecond ticks since 00:00 November 17, 1858 in a Quadword. So I am making the assumption that the application that produces the file will also use the same storage method.
Any suggestions how I could turn this 8 byte string into a usable number? I have tried unpack, but there are no formats for a 64bit number.
To add insult to injury, my windows 64bit version of php seems to not be able to use 64 ints according to PHP_INT_MAX and PHP_INT_SIZE contstants.
Thanks!
PS: one of the dates in question is: 80 42 8D 73 2C F7 A9 00, straight out of a hex editor. Ive tried the conversion manually, but I am not sure if I did the conversion correctly... as the numbers I came up with wouldnt give anywhere near a current date.
Im working on a project that involves reading a file generated on another platform (OpenVMS running on Itanium). The file stores a date in a Quadword, according to the file documentation I have. The file spec docs do not specify the date format, but I did find documentation for how OpenVMS stores dates... the number of 100 nanosecond ticks since 00:00 November 17, 1858 in a Quadword. So I am making the assumption that the application that produces the file will also use the same storage method.
Any suggestions how I could turn this 8 byte string into a usable number? I have tried unpack, but there are no formats for a 64bit number.
To add insult to injury, my windows 64bit version of php seems to not be able to use 64 ints according to PHP_INT_MAX and PHP_INT_SIZE contstants.
Thanks!
PS: one of the dates in question is: 80 42 8D 73 2C F7 A9 00, straight out of a hex editor. Ive tried the conversion manually, but I am not sure if I did the conversion correctly... as the numbers I came up with wouldnt give anywhere near a current date.