Re: How to handle a 64bit FILETIME?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Lynch wrote:

Tom Cannaerts wrote:

I'm processing a binary file, and in that file there is a 64bit FILETIME
value. This value represents the number of 100-nanoseconds since 1/1/1601.

I would like to convert it to a somewhat more usable value, since I
eventually will need to display that value as a human readable date.


In addition to the BC_MATH package, there's some new-fangled extension to
PHP that does the same kind of stuff.

I'm not quite sure how you are going to get the 32 bytes into a string
suitable for sending *TO* either of those packages, however...

I'm guessing you'll have to read 32 bits, throw that into BC_MATH,
multiply by 0xFFFFFFFF, grab the next 32 bits, and add that in BC_MATH...

Then, you'll have to divide by 100-nanoseconds and/or subtract enough
seconds to get to whatever time format you want to use.

or, since you won't be showing it in such precision, you could cut off a whole bunch from the end, and simply divide by a factor 10^numbers_you_let_off less :)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux