php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68531 getdate() new minutes
Submitted: 2014-12-01 06:06 UTC Modified: 2015-09-13 04:22 UTC
From: raphaelfox at orange dot fr Assigned: cmb (profile)
Status: No Feedback Package: Date/time related
PHP Version: 5.5Git-2014-12-01 (snap) 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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: raphaelfox at orange dot fr
New email:
PHP Version: OS:

 

 [2014-12-01 06:06 UTC] raphaelfox at orange dot fr
Description:
------------
---
From manual page: http://www.php.net/function.getdate
---
getdate() when new minute put the second to 0(normal) but the minutes to 1 in the array result.
doesn't appear with timestamp parameter.

Test script:
---------------
$today = getdate();

if ($today['hours'] != 6 || $today['minutes'] < 49 || ($today['minutes'] = 49 && $today['seconds'] < 30 && (!($today['minutes'] = 1 && $today['seconds'] = 0))))
{
	print_r($today);
}

Expected result:
----------------
Array ( [seconds] => 0 [minutes] => 54 [hours] => 6 [mday] => 1 [wday] => 1 [mon] => 12 [year] => 2014 [yday] => 334 [weekday] => Monday [month] => December [0] => 1417413240 )

Actual result:
--------------
Array ( [seconds] => 0 [minutes] => 1 [hours] => 6 [mday] => 1 [wday] => 1 [mon] => 12 [year] => 2014 [yday] => 334 [weekday] => Monday [month] => December [0] => 1417413240 )

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-08-31 13:44 UTC] cmb@php.net
-Status: Open +Status: Feedback -Package: date_time +Package: Date/time related -Assigned To: +Assigned To: cmb
 [2015-08-31 13:44 UTC] cmb@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

Something like <https://3v4l.org/od0eB> would be a proper
reproducing script, but it doesn't show the misbehavior you've
found.
 [2015-09-13 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Jan 23 04:03:35 2022 UTC