3v4l.org

run code in 300+ PHP versions simultaneously
<?php function IEEE64Float($strHex) { // Thanx Chung Leong https://bytes.com/topic/php/answers/9237-hex-floating-point#post38346 $hex = sscanf($strHex, "%02x%02x%02x%02x%02x%02x%02x%02x"); $hex = array_reverse($hex); $bin = implode('', array_map('chr', $hex)); $array = unpack("dnum", $bin); return $array['num']; } function UnMicrosoftify($fDateValue = 0, $iDateBase = 1900) { //http://stackoverflow.com/q/26589406/795054 if ($iDateBase == 1900) { $iMyDateBase = 25569; //Adjust for the fictional 29-Feb-1900 (Day 60) if ($fDateValue < 60) { --$iMyDateBase; } } else { $iMyDateBase = 24107; } // Perform conversion if ($fDateValue >= 1) { $utcDays = $fDateValue - $iMyDateBase; $iReturnValue = round($utcDays * 86400); if (($iReturnValue <= PHP_INT_MAX) && ($iReturnValue >= -PHP_INT_MAX)) { $iReturnValue = (integer) $iReturnValue; } } else { $hours = round($fDateValue * 24); $mins = round($fDateValue * 1440) - round($hours * 60); $secs = round($fDateValue * 86400) - round($hours * 3600) - round($mins * 60); $iReturnValue = (integer) gmmktime($hours, $mins, $secs); } return $iReturnValue; } function PGODdate($strhex) { return date('Y-m-d', UnMicrosoftify(IEEE64Float($strhex))); } echo PGODdate('FE37E43C8800759C');

preferences:
37.16 ms | 402 KiB | 5 Q