且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将LDAP时间戳转换为Unix时间戳

更新时间:2023-01-22 12:19:33

请参阅此处.

实际上,归结为将FILETIME时间戳转换为UNIX时间戳:

Actually it boils down to converting the FILETIME timestamp into a 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);