Convert Windows UTC time to Unix epoch

/ Published in: PHP
Save to your folder(s)

This function simply takes a Windows UTC timestamp and converts it to Unix epoch.
This was useful when I was pulling LDAP information from Active Directory and the timestamps were ridiculous. Windows builds timestamps by counting seconds since January 1 1601.

Copy this code and paste it in your HTML
  1. function convert_windows_time_to_unix($wintime) {
  2. return $wintime / 10000000 - 11644473600;
  3. }


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.