#19362 [NEW]: mktime return bad date
| From: | ptrincavelli at nuevobancobisel dot com dot ar | Date: | Wed, 11 Sep 2002 18:47:54 +0000 |
| Subject: | #19362 [NEW]: mktime return bad date | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-19184@lists.php.net to get a copy of this message | ||
From: ptrincavelli@nuevobancobisel.com.ar
Operating system: Solaris 8
PHP version: 4.2.2
PHP Bug Type: Date/time related
Bug description: mktime return bad date
This code is supposed to return the same output in the two "echos" because
we simple take the date from the S.O. then I split it in the variables for
day, month and year and then when we create the date again from this very
same value it gives the wrong output in a Solaris 8 machine with php 4.2.2
and 4.2.3
It works ok in Solaris 7 and php 4.1.1
<?
// ******************
// Tomo el dia de hoy
// ******************
$FechaDeHoy = time();
$td = gmdate("d",$FechaDeHoy);
$tm = gmdate("m",$FechaDeHoy);
$ta = gmdate("Y",$FechaDeHoy);
$FechaDeHoy = mktime(0,0,0,$tm,$td,$ta);
echo "<br>$FechaDeHoy = mktime(0,0,0,$tm,$td,$ta)";
$td = gmdate("d",$FechaDeHoy);
$tm = gmdate("m",$FechaDeHoy);
$ta = gmdate("Y",$FechaDeHoy);
$FechaDeHoy = mktime(0,0,0,$tm,$td,$ta);
echo "<br>$FechaDeHoy = mktime(0,0,0,$tm,$td,$ta)";
?>
--
Edit bug report at http://bugs.php.net/?id=19362&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=19362&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=19362&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=19362&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=19362&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=19362&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19362&r=support
Expected behavior: http://bugs.php.net/fix.php?id=19362&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=19362&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=19362&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=19362&r=globals