php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29825 mktime returns incorrect timestamp
Submitted: 2004-08-24 21:53 UTC Modified: 2004-08-25 08:28 UTC
From: biv777 at front dot ru Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 4.3.7 OS: FreeBSD 4.8
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: biv777 at front dot ru
New email:
PHP Version: OS:

 

 [2004-08-24 21:53 UTC] biv777 at front dot ru
Description:
------------
 

Reproduce code:
---------------
<?
$f_tm=1080075600; //3-24-2004
for($i=0; $i<7; $i++) 
{
	$arr_tm[]=$f_tm;
    $f_tm=mktime(0, 0, 0, date("n",$f_tm), (date("j",$f_tm)+1), date("Y",$f_tm));
}
foreach($arr_tm as $tm)
{
	echo $tm." ".date("Y",$tm)."-".date("m",$tm)."-".date("d",$tm)."<br>";
}
?>

Expected result:
----------------
HTTP/1.1 200 OK
Date: Tue, 24 Aug 2004 19:44:04 GMT
Server: Apache/1.3.31 (Unix) mod_accounting/0.5l mod_ssl/2.8.18 OpenSSL/0.9.7d mod_deflate/1.0.21
X-Powered-By: PHP/4.3.5
Connection: close
Content-Type: text/html; charset=windows-1251
1048453200 2003-03-24
1048539600 2003-03-25
1048626000 2003-03-26
1048712400 2003-03-27
1048798800 2003-03-28
1048885200 2003-03-29
-7262 1970-01-01

Actual result:
--------------
 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-25 08:28 UTC] derick@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

4.3.5 is too old.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 13:01:30 2024 UTC