Re: How to handle a 64bit FILETIME?

From: Date: Thu, 03 Mar 2005 18:42:04 +0000
Subject: Re: How to handle a 64bit FILETIME?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-209938@lists.php.net to get a copy of this message
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. -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#209938) next »