note 33180 added to function.ldap-get-entries
| From: | reaper at sci dot fi | Date: | Wed, 18 Jun 2003 11:09:35 +0000 |
| Subject: | note 33180 added to function.ldap-get-entries | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-50572@lists.php.net to get a copy of this message | ||
If you're dealing with Active Directory and need to get values like 'lastlogon',
'pwdlastset' or similar, you'll notice that AD gives the values as Windows FILETIME
timestamps. That means, the values are 100-nanosecond units passed since 1.1.1600 00:00:00.
To convert these to unix timestamps which PHP's date functions understand, one easy way would
be the following :
function win_filetime_to_timestamp ($filetime) {
$win_secs = substr($filetime,0,strlen($filetime)-7); // divide by 10 000 000 to get seconds
$unix_timestamp = ($win_secs - 11644473600); // 1.1.1600 -> 1.1.1970 difference in seconds
return $unix_timestamp;
}
----
Manual Page -- http://www.php.net/manual/en/function.ldap-get-entries.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33180
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33180&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33180&report=yes