note 60039 rejected from function.preg-replace by nlopess

From: Date: Fri, 23 Dec 2005 18:40:18 +0000
Subject: note 60039 rejected from function.preg-replace by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-100626@lists.php.net to get a copy of this message
Note Submitter: Chris Ross, hitmix at gmx dot net ---- Hi, (sorry for my bad english) :) in php 5.04 (Windows-Version) is maybe a bug in mktime! if i try mktime(0,0,0, 05,09,2006) the result is: 1146348000 if i try mktime(0,0,0, 5,9,2006) the result is: 1147125600 ?! otherwise if i try mktime(0,0,0, 06,04,2006) or mktime(0,0,0, 6,4,2006) the result are both 1149372000 ?!?!? however .. just in case i converting the $_POST['date'] value, bevor i transfer it to mktime: if($_POST['date']) { $dat = explode(".", $_POST['date']); $day = preg_replace('/(^0)/', '', $dat[0]); $mon = preg_replace('/(^0)/', '', $dat[1]); $year = $dat[2]; $time = mktime(0, 0, 0, $mon,$day,$jahr); } in this case mktime results the correct value greets Chris

« previous php.notes (#100626) next »