php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75834 Certain relative format dates do not return midnight as they should
Submitted: 2018-01-17 13:32 UTC Modified: 2018-03-25 13:39 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: igor dot yavych at gmail dot com Assigned:
Status: Open Package: Date/time related
PHP Version: Irrelevant OS: Unix
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: igor dot yavych at gmail dot com
New email:
PHP Version: OS:

 

 [2018-01-17 13:32 UTC] igor dot yavych at gmail dot com
Description:
------------
Title says it all, test script, expected result and actual result section demonstrate the problem

Test script:
---------------
strtotime('first day of this month'); 
strtotime('last day of this month');
strtotime('first day of last month');
strtotime('last day of last month');
strtotime('first day of this month UTC')
strtotime('last day of this month UTC');
strtotime('first day of last month UTC');
strtotime('last day of last month UTC');

Expected result:
----------------
For all of the above, in the test script part, it should output midnight of that date in a respective TZ (either server (first 4) or UTC (last 4)), as other relativate formats do (for example 'monday last week UTC', 'sunday this week UTC', etc). Expected result can be achieved if you put 'midnight' in the begining of each string, ie 'midnight last day of last month UTC'

Actual result:
--------------
For all of the above, in the test script part, it outputs the correct date but instead of midnight, it's current time in a respective TZ (either server (first 4) or UTC (last 4))

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-03-25 13:39 UTC] cmb@php.net
-Package: date_time +Package: Date/time related
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Sep 28 13:01:23 2020 UTC