
Yuri Nunes - 2014-01-16 20:01:58 -
In reply to message 4 from Sergey Shuchkin
Hi friend, I did some testing and found another problem, but now, in my correction. I do not know if you've tested my function. The problem happens because of DST(Daylight Saving Time). I'm in Brazil and at the moment, we are in the summer time and this makes the function of converting dates do not work properly. So to fix this, I set the timezone to UTC.
function unixstamp( $excelDateTime ) {
date_default_timezone_set('UTC');
$d = floor( $excelDateTime ); // seconds since 1900
$t = $excelDateTime - $d;
return ($d > 0) ? ( $d - 25569 ) * 86400 + $t * 86400 : $t * 86400;
}
I hope to help me and excuse my bad english.