Doc #78835 [Opn->Csd]: Ambiguous definition of format character

From: Date: Sun, 08 Dec 2019 15:22:25 +0000
Subject: Doc #78835 [Opn->Csd]: Ambiguous definition of format character
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-17093@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78835&edit=1 ID: 78835 Updated by: cmb@php.net Reported by: filipbengtsson at live dot se Summary: Ambiguous definition of format character -Status: Open +Status: Closed Type: Documentation Problem Package: Date/time related Operating System: Windows 7 PHP Version: 7.1.33 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2019-12-08 15:21:59] cmb@php.net Automatic comment from SVN on behalf of cmb Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=348466 Log: Fix #78835: Ambiguous definition of format character ------------------------------------------------------------------------ [2019-11-18 23:36:02] filipbengtsson at live dot se Description: ------------ --- From manual page: https://php.net/function.date --- The manual page says that the format character O (capital letter o) represents "difference to Greenwich time (GMT) in hours", but the example says +0200, which I would describe as is 100 times greater than the time difference (and what it, after some testing, seems to actually do). It could also be interpreted as GMT offset by 200 hours (little over a week). The bigger mystery is what the two trailing zeros do. I asumed they represent centiminutes (going from 00-99) since the documentation doesn't say anything about minutes. By running the following script, they turned out to be minutes (00-59). Test script: --------------- <?php // Set timezone to UTC-03:30 date_default_timezone_set("America/St_Johns"); echo date("O"); ?> Expected result: ---------------- -0350 Actual result: -------------- -0330 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=78835&edit=1

« previous php.doc.bugs (#17093) next »