php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #398 mktime won't correctly take string of all parameters
Submitted: 1998-05-22 15:36 UTC Modified: 1998-05-22 18:57 UTC
From: williams at web-arch dot com Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0 Release Candidate 4 OS: Solaris 2.5.1
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: williams at web-arch dot com
New email:
PHP Version: OS:

 

 [1998-05-22 15:36 UTC] williams at web-arch dot com
$YR=1995;
$MN=4;
$DY=1;

/* this works: */
$todayts = mktime(0,0,01,$MN,$DY,$YR);
echo "TODAYTS TEST:" . Date("M d y, H:i:s",$todayts);

/* this gets only the hour correct, otherwise it uses the current date and time */
$midnight="0,0,01,$MN,$DY,$YR";
$todayts = mktime($midnight);
echo "|$midnight|TODAYTS TEST:" . Date("M d y, H:i:s",$todayts);

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-05-22 18:57 UTC] zeev
As Lars said, this isn't a bug at all.
Sending a one coma delimited string is not the same
as sending several arguments to a function.
You can use Lars' suggestion and use explode(), or
you can do something like
eval("\$time=mktime($str);");


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 21:01:27 2025 UTC