tags:

views:

1229

answers:

3

I've determined that I need to convert a Windows FILETIME type to something PHP can work with. I want this to be a PHP function.

Say I have this value: 60 F3 47 D1 57 98 C9 01

Step 1: (Thanks to this page http://www.cyanwerks.com/file-format-url.html) I know I need to change the order to 01 C9 98 57 D1 47 F3 60

Step 2: ?????

+2  A: 

From the MSDN documentation:

Contains a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC).

Rob Kennedy
+1  A: 
lynn
You couldn't have written all that code in the three minutes since posting the question, so unless you knew the answer before you asked, that's not your code. Could you please cite the source?
Rob Kennedy
Iit was the solution from http://stackoverflow.com/questions/610603/help-me-translate-long-value-expressed-in-hex-back-in-to-a-date-time And I can't delete this question as redundant. Editing response to give credit where it's due.
lynn
Terrific. Thanks!
Rob Kennedy
That is an very ugly bit of code for dealing with a such simple problem.
Cheeso
A: 

What kind of time does PHP need? Is it a time_t? if so, just subtract your DateTime from the unix epoch (1970-jan-01 UTC) and grab the TotalSeconds value.

Cheeso