php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #19515 Parameters of function strtotime() seem wrong
Submitted: 2002-09-20 02:23 UTC Modified: 2002-09-20 02:27 UTC
From: dallas@php.net Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 4CVS-2002-09-20 OS:
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: dallas@php.net
New email:
PHP Version: OS:

 

 [2002-09-20 02:23 UTC] dallas@php.net
Function strtotime() is defined as below:

int strtotime ( string time [, int now])

But when I try this function, whatever value I provide to 'now' seem no affect to the result at all.
I've tried following example:

echo strtotime("Jan 1 1970"), "\n";
echo strtotime("Jan 1 1970", 10000), "\n";
echo strtotime("Jan 1 1970", time()), "\n";

and the result is(PHP 4.0.6, 4.2.3, 4.3.0, Linux, Windows):

18000
18000
18000

I'm in GMT-0500, so I guess the result is correct.  But what exactly the parameter 'now' for?  I supposed strtotime() function behave correctly,  so 'now' is just meaningless.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-20 02:27 UTC] cynic@php.net
"Jan 1 1970" is an absolute date. how do you want to change it's timestamp?
reread the docs.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 14:01:36 2025 UTC