|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull Requests
Pull requests: HistoryAllCommentsChangesGit/SVN commits              [2016-04-24 21:06 UTC] requinix@php.net
 
-Status: Open
+Status: Verified
  [2016-04-24 21:06 UTC] requinix@php.net
  [2017-03-09 15:46 UTC] nikic@php.net
  [2017-03-09 15:46 UTC] nikic@php.net
 
-Status: Verified
+Status: Closed
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 03:00:01 2025 UTC | 
Description: ------------ For dates prior to 1970, (i.e. dates represented by a negative unix timestamp value), swatch values produced by the gmdate() function using format character 'B' are incorrectly rounded-up. They consequently differ from the values produced for identical times of day on dates after 1970, as these are correctly rounded-down. This problem occurs on PHP 5.3 as well as 5.6. Test script: --------------- for ($unix=1461283200;$unix<=1461369600;$unix+=8000) { echo "\n Time:".gmdate('Y-m-d H:i:s = B ',$unix); echo " Time:".gmdate('Y-m-d H:i:s = B ',$unix-2592000000); } Expected result: ---------------- I would expect the three-digit swatch time values produced for the 1934 date (right-hand column) to be identical to the swatch values produced for the 2016 date (left-hand column), for any given time of day. Actual result: -------------- Time:2016-04-22 00:00:00 = 041 Time:1934-03-04 00:00:00 = 041 Time:2016-04-22 02:13:20 = 134 Time:1934-03-04 02:13:20 = 135 Time:2016-04-22 04:26:40 = 226 Time:1934-03-04 04:26:40 = 227 Time:2016-04-22 06:40:00 = 319 Time:1934-03-04 06:40:00 = 320 Time:2016-04-22 08:53:20 = 412 Time:1934-03-04 08:53:20 = 413 Time:2016-04-22 11:06:40 = 504 Time:1934-03-04 11:06:40 = 505 Time:2016-04-22 13:20:00 = 597 Time:1934-03-04 13:20:00 = 598 Time:2016-04-22 15:33:20 = 689 Time:1934-03-04 15:33:20 = 690 Time:2016-04-22 17:46:40 = 782 Time:1934-03-04 17:46:40 = 783 Time:2016-04-22 20:00:00 = 875 Time:1934-03-04 20:00:00 = 875 Time:2016-04-22 22:13:20 = 967 Time:1934-03-04 22:13:20 = 968