#19362 [Opn->Bgs]: mktime return bad date
| From: | iliaa@php.net | Date: | Tue, 24 Sep 2002 20:43:08 +0000 |
| Subject: | #19362 [Opn->Bgs]: mktime return bad date | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-20229@lists.php.net to get a copy of this message | ||
ID: 19362
Updated by: iliaa@php.net
Reported By: ptrincavelli@nuevobancobisel.com.ar
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: Solaris 8
PHP Version: 4.2.2
New Comment:
Cannot replicate on Solaris,Linux or Windows.
Previous Comments:
------------------------------------------------------------------------
[2002-09-24 15:40:44] dark_panda@hushmail.com
On Solaris 8 (SPARC) with 4.2.3, I'm getting
1032840000 = mktime(0,0,0,09,24,2002)
1032840000 = mktime(0,0,0,09,24,2002)
Which is what I'd expect, is it not?
J
------------------------------------------------------------------------
[2002-09-11 13:47:54] ptrincavelli@nuevobancobisel.com.ar
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 this bug report at http://bugs.php.net/?id=19362&edit=1