Doc #78835 [NEW]: Ambiguous definition of format character
| From: | filipbengtsson at live dot se | Date: | Mon, 18 Nov 2019 23:36:02 +0000 |
| Subject: | Doc #78835 [NEW]: Ambiguous definition of format character | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-17067@lists.php.net to get a copy of this message | ||
From: filipbengtsson at live dot se
Operating system: Windows 7
PHP version: 7.1.33
Package: Date/time related
Bug Type: Documentation Problem
Bug description:Ambiguous definition of format character
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 bug report at https://bugs.php.net/bug.php?id=78835&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=78835&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78835&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78835&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78835&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78835&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78835&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78835&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78835&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78835&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78835&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=78835&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=78835&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78835&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78835&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78835&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78835&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78835&r=mysqlcfg