note 30779 added to function.mktime
| From: | php at ekto dot ekol dot co dot uk | Date: | Fri, 28 Mar 2003 10:56:55 +0000 |
| Subject: | note 30779 added to function.mktime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-45943@lists.php.net to get a copy of this message | ||
mktime() seems to be broken in at least on respect on PHP 4.3.1 on SunOS 5.6 (sun4u). Given:
mktime(0,0,0,3,30,2003)
Outputting the result gives a date of 2003-29-03. Specifying a day of '29' or
'31' produces the correct results.
The following function can be used as a replacement:
function xmktime($hour, $minute, $second, $month, $day, $year)
{
return strtotime(intval($year) . '-' . intval($month) . '-' .
intval($day) .' ' . intval($hour) . ':' . intval($minute) .
':' . intval($second));
}
--
http://www.php.net/manual/en/function.mktime.php
http://master.php.net/manage/user-notes.php?action=edit+30779
http://master.php.net/manage/user-notes.php?action=delete+30779
http://master.php.net/manage/user-notes.php?action=reject+30779