|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-03-25 13:39 UTC] cmb@php.net
-Package: date_time
+Package: Date/time related
[2021-07-14 14:13 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Assigned To:
+Assigned To: cmb
[2021-07-14 14:13 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Fri Jan 30 03:00:01 2026 UTC |
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))