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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 08:01:29 2024 UTC