Created
May 19, 2016 02:46
-
-
Save huzemin/4df9f495b046de2a9b5484677c15c44c to your computer and use it in GitHub Desktop.
Win32 FILETIME to UNIXTIME
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| # http://stackoverflow.com/questions/4647169/how-to-convert-ldap-timestamp-to-unix-timestamp | |
| $fileTime = "130435290000000000"; | |
| $winSecs = (int)($fileTime / 10000000); // divide by 10 000 000 to get seconds | |
| $unixTimestamp = ($winSecs - 11644473600); // 1.1.1600 -> 1.1.1970 difference in seconds | |
| echo date(DateTime::RFC822, $unixTimestamp); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment