note 30779 deleted from function.mktime by vincent

From: Date: Thu, 11 Sep 2003 20:37:23 +0000
Subject: note 30779 deleted from function.mktime by vincent
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-56252@lists.php.net to get a copy of this message
Note Submitter: php@ekto.ekol.co.uk ---- 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)); }

« previous php.notes (#56252) next »