Bug #75834 [Opn->Nab]: Certain relative format dates do not return midnight as they should

From: Date: Wed, 14 Jul 2021 14:13:41 +0000
Subject: Bug #75834 [Opn->Nab]: Certain relative format dates do not return midnight as they should
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235033@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75834&edit=1 ID: 75834 Updated by: cmb@php.net Reported by: igor dot yavych at gmail dot com Summary: Certain relative format dates do not return midnight as they should -Status: Open +Status: Not a bug Type: Bug Package: Date/time related Operating System: Unix PHP Version: Irrelevant -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Previous Comments: ------------------------------------------------------------------------ [2018-01-17 13:32:04] 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)) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75834&edit=1

« previous php.bugs (#235033) next »