Bug #76147 [Csd->Nab]: DateTime->setTime( 0, 0, 0 ) fast forwards to tomorrow if in the 23rd hour
| From: | requinix@php.net | Date: | Mon, 26 Mar 2018 19:10:34 +0000 |
| Subject: | Bug #76147 [Csd->Nab]: DateTime->setTime( 0, 0, 0 ) fast forwards to tomorrow if in the 23rd hour | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-214493@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76147&edit=1
ID: 76147
Updated by: requinix@php.net
Reported by: tko at tourkick dot com
Summary: DateTime->setTime( 0, 0, 0 ) fast forwards to
tomorrow if in the 23rd hour
-Status: Closed
+Status: Not a bug
Type: Bug
Package: Date/time related
PHP Version: 7.2.3
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2018-03-26 18:30:31] tko at tourkick dot com
Good idea to add a script. For some reason I wasn't able to replicate it again. Sorry for the
trouble.
------------------------------------------------------------------------
[2018-03-26 03:32:20] requinix@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 <?php and ends 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.
Works for me. https://3v4l.org/1gsAT
Even works for timezones that began DST today at midnight (eg, Asia/Beirut).
------------------------------------------------------------------------
[2018-03-25 21:53:18] tko at tourkick dot com
Description:
------------
---
From manual page: http://www.php.net/datetime.settime
---
If your DateTime object is in the 23rd hour, such as
2018-03-25 23:44:02.208780, and
you use setTime( 0, 0, 0 ), it will fast forward to tomorrow (2018-03-26
00:00:00.000000) instead of truncating the minutes (2018-03-25 00:00:00.000000),
as it does for all other hours of the day.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76147&edit=1