php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36230 strtotime returns odd timestamp with empty parameter
Submitted: 2006-01-31 15:54 UTC Modified: 2006-01-31 16:17 UTC
From: hancoque at gmx dot de Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 4.4.2 OS: Linux/Windows
Private report: No CVE-ID: None
 [2006-01-31 15:54 UTC] hancoque at gmx dot de
Description:
------------
When calling strtotime with an empty parameter it doesn't return an equivalent of time() but a timestamp that is missing hours, minutes and seconds (current day at 12:00 AM).

I found it in 4.4.1 and checked if it still exists in 4.4.2, which it does. The problem occurs on the server of my webhoster (Linux) and on my test server at home (Windows).

Reproduce code:
---------------
echo strtotime("");

Expected result:
----------------
1138718685

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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-31 15:59 UTC] derick@php.net
I don't see why this is wrong... it's not meant to work in the first place.
 [2006-01-31 16:17 UTC] hancoque at gmx dot de
Uhm, but this apparently works in PHP 5.11. And let me quote from the manual:

"The function expects to be given a string [...] and will try to parse that format into a Unix timestamp [...], relative to the timestamp given in now, or the current time if none is supplied."
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Sep 21 01:01:27 2024 UTC