Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does Windows FILETIME contain? Trying to convert to a PHP date/time

Tags:

c#

php

datetime

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: ?????

like image 228
lynn Avatar asked Oct 14 '25 16:10

lynn


2 Answers

From the MSDN documentation:

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

like image 117
Rob Kennedy Avatar answered Oct 17 '25 04:10

Rob Kennedy


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.

like image 41
Cheeso Avatar answered Oct 17 '25 04:10

Cheeso