php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19362 mktime return bad date
Submitted: 2002-09-11 13:47 UTC Modified: 2002-09-24 15:43 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: ptrincavelli at nuevobancobisel dot com dot ar Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 4.2.2 OS: Solaris 8
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ptrincavelli at nuevobancobisel dot com dot ar
New email:
PHP Version: OS:

 

 [2002-09-11 13:47 UTC] ptrincavelli at nuevobancobisel dot com dot 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)";

?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-24 15:40 UTC] dark_panda at hushmail dot 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-24 15:43 UTC] iliaa@php.net
Cannot replicate on Solaris,Linux or Windows.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 03:01:32 2025 UTC