php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50913 mktime() won't go before 1901
Submitted: 2010-02-02 16:16 UTC Modified: 2010-02-02 16:54 UTC
From: drsmall at mycroftserve dot homelinux dot org Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2SVN-2010-02-02 (snap) OS: Debian
Private report: No CVE-ID: None
 [2010-02-02 16:16 UTC] drsmall at mycroftserve dot homelinux dot org
Description:
------------
Anything before 12 31, 1901 will not produce output.

Reproduce code:
---------------
<?php 
// This will produce output.
echo mktime(0,0,0,12,31,1901);

// This will not.
echo mktime(0,0,0,1,1,1900);
?>


Expected result:
----------------
line 3 will display a timestamp with a negative value.
line 6 will display a timestamp with a negative value.

Actual result:
--------------
line 6 does not return a timestamp with a negative value.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-02-02 16:54 UTC] rasmus@php.net
Not a bug.  UNIX timestamps are limited to 32 bit integers on 32 bit 
machines so your effective range is 1901-2038 or so.  Use 
http://php.net/datetime instead if you need a larger range or move to a 
64-bit platform.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 00:01:30 2024 UTC