note 72712 deleted from ref.datetime by felipe

From: Date: Mon, 10 Dec 2007 17:48:56 +0000
Subject: note 72712 deleted from ref.datetime by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-133211@lists.php.net to get a copy of this message
Note Submitter: h3 at valleyfield dot net ---- EXCEL DATES TO UNIX TIMESTAMPS 2.0 ---------------------------- In reply of the comment left on 24-Mar-2003 10:17 The function is broken, and they output date was alwasy offset of 1 day. I think it is caused by a leap year bug in excel. Here is a fixed version, now the date match exactly what they should match. function xl2timestamp($timestamp) { return ($timestamp - 25568) * 86400; } eg; echo date('Y-m-d',xl2timestamp(38976)); I found the infos on this bug in; http://tinyurl.com/28lltv cheers.

« previous php.notes (#133211) next »