Skip to content

Instantly share code, notes, and snippets.

@huzemin
Created May 19, 2016 02:46
Show Gist options
  • Select an option

  • Save huzemin/4df9f495b046de2a9b5484677c15c44c to your computer and use it in GitHub Desktop.

Select an option

Save huzemin/4df9f495b046de2a9b5484677c15c44c to your computer and use it in GitHub Desktop.
Win32 FILETIME to UNIXTIME
<?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