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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 06:01:29 2024 UTC