note 72712 added to ref.datetime
| From: | h3 at valleyfield dot net | Date: | Tue, 30 Jan 2007 18:56:25 +0000 |
| Subject: | note 72712 added to ref.datetime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-122370@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 216.235.15.211
Probable Submitter: 206.248.136.28
----
Manual Page -- http://www.php.net/manual/en/ref.datetime.php
Edit -- https://master.php.net/note/edit/72712
Del: integrated -- https://master.php.net/note/delete/72712/integrated
Del: useless -- https://master.php.net/note/delete/72712/useless
Del: bad code -- https://master.php.net/note/delete/72712/bad+code
Del: spam -- https://master.php.net/note/delete/72712/spam
Del: non-english -- https://master.php.net/note/delete/72712/non-english
Del: in docs -- https://master.php.net/note/delete/72712/in+docs
Del: other reasons-- https://master.php.net/note/delete/72712
Reject -- https://master.php.net/note/reject/72712
Search -- https://master.php.net/manage/user-notes.php