php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #52488 Date problem
Submitted: 2010-07-29 17:23 UTC Modified: 2010-07-29 17:27 UTC
From: pssubashps at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.3.3 OS:
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: pssubashps at gmail dot com
New email:
PHP Version: OS:

 

 [2010-07-29 17:23 UTC] pssubashps at gmail dot com
Description:
------------
Hai,
While i excuting the below script i got unexpected result.

<?php
print date("d-m-Y", mktime(0, 0, 0, 7, 1, 2038));
?>

i got the output is 01-01-1970.
i know the problem in php core.
php date funnction changelog:
The valid range of a timestamp is typically from Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are the dates that correspond to the minimum and maximum values for a 32-bit signed integer). However, before PHP 5.1.0 this range was limited from 01-01-1970 to 19-01-2038 on some systems (e.g. Windows).

how we resolve this problem.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-07-29 17:27 UTC] degeberg@php.net
-Status: Open +Status: Bogus
 [2010-07-29 17:27 UTC] degeberg@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

It overflows the range of integers on your system. Seeing as you're using 5.3, you can use the DateTime class instead.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 07:01:27 2024 UTC