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
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: drsmall at mycroftserve dot homelinux dot org
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 09 14:01:33 2025 UTC