note 74369 added to function.strtotime
| From: | AlanGruskoff at osu1 dot php dot net | Date: | Sun, 08 Apr 2007 01:31:16 +0000 |
| Subject: | note 74369 added to function.strtotime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-125181@lists.php.net to get a copy of this message | ||
This function inputs a date sting and outputs an integer that is the internal representation of days
that spreadsheets use. Post this value into a cell, then format that cell as a Date.
function conv_to_xls_date($Date) {
// Returns the Excel/Calc internal date integer from either an ISO date YYYY-MM-DD or MM/DD/YYYY
formats.
return (int) (25569 + (strtotime("$Date 12:00:00") / 86400));
}
example:
$Date = "04-07-2007";
$Days = conv_to_xls_date($Date);
$Days will contain 39179
----
Server IP: 69.147.83.197
Probable Submitter: 67.101.168.118
----
Manual Page -- http://www.php.net/manual/en/function.strtotime.php
Edit -- https://master.php.net/note/edit/74369
Del: integrated -- https://master.php.net/note/delete/74369/integrated
Del: useless -- https://master.php.net/note/delete/74369/useless
Del: bad code -- https://master.php.net/note/delete/74369/bad+code
Del: spam -- https://master.php.net/note/delete/74369/spam
Del: non-english -- https://master.php.net/note/delete/74369/non-english
Del: in docs -- https://master.php.net/note/delete/74369/in+docs
Del: other reasons-- https://master.php.net/note/delete/74369
Reject -- https://master.php.net/note/reject/74369
Search -- https://master.php.net/manage/user-notes.php