php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36309 strtotime() returns -1, NOT false as the docs say it should.
Submitted: 2006-02-07 00:54 UTC Modified: 2006-02-07 08:24 UTC
From: ipso at snappymail dot ca Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.1.2 OS: Linux
Private report: No CVE-ID: None
 [2006-02-07 00:54 UTC] ipso at snappymail dot ca
Description:
------------
strtotime() returns -1 when it should return FALSE as per the docs for PHP v5.1.2

Reproduce code:
---------------
strtotime('1969-12-31 15:59:59-08');

returns: -1

Expected result:
----------------
expected return of: FALSE with PHP v5.1.2

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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-07 08:24 UTC] derick@php.net
No bug here. The time that you specify (1969-12-31 15:59:59-08) is exactly one second before the epoch starts (1970-01-01 00:00 GMT) and thus the function correctly returns -1.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sun Mar 29 05:00:02 2026 UTC