php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #76748 date format timezone abbreviations and changes not well documented
Submitted: 2018-08-15 15:49 UTC Modified: 2018-08-15 16:05 UTC
Votes:3
Avg. Score:3.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (50.0%)
From: georgekazdev at gmail dot com Assigned:
Status: Closed Package: Date/time related
PHP Version: 7.1.20 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: georgekazdev at gmail dot com
New email:
PHP Version: OS:

 

 [2018-08-15 15:49 UTC] georgekazdev at gmail dot com
Description:
------------
From versions 7.0.17 to 7.0.18 and from 7.1.3 to 7.1.4 many timezone abbreviations were removed as discussed here: http://mm.icann.org/pipermail/tz/2017-February/024837.html

But the changelog (http://php.net/ChangeLog-7.php) does not mention this and neither does http://www.php.net/manual/en/function.date.php

Before the change, the expected return for the test script below was:
MVT
MVT

but after the change it's
+05
+05

To save time tracing this problem, please consider updating documentation to mention the changes, either to say that the 'T' formatter will return the date diff if there is no abbreviation, or to mention it in the change log. It would help in knowing that it's not a bug. A list of valid abbreviations would also be useful. 

Thanks


Test script:
---------------
<?php

$date = new DateTime('Feb 13, 2009 11:31:30 PM', new DateTimeZone('Indian/Maldives'));
echo $date->format('T').PHP_EOL;

$date = date_create('Feb 13, 2009 11:31:30 PM', timezone_open('Indian/Maldives'));
echo date_format($date, 'T').PHP_EOL;

Expected result:
----------------
MVT
MVT


Actual result:
--------------
+05
+05

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-08-15 16:00 UTC] cmb@php.net
-Package: Documentation problem +Package: Date/time related
 [2018-08-15 16:05 UTC] georgekazdev at gmail dot com
-: egeorgekaz at gmail dot com +: georgekazdev at gmail dot com
 [2018-08-15 16:05 UTC] georgekazdev at gmail dot com
changed email address
 [2021-08-04 14:56 UTC] git@php.net
Automatic comment on behalf of cmb69
Revision: https://github.com/php/doc-en/commit/cafd6b7449774060e37f78a6a93e42e909668c15
Log: Fix #76748: date format timezone abbreviations and changes not well documented
 [2021-08-04 14:56 UTC] git@php.net
-Status: Open +Status: Closed
 [2021-08-06 01:24 UTC] git@php.net
Automatic comment on behalf of mumumu
Revision: https://github.com/php/doc-ja/commit/92d0d5e4bff65f0a388a8f407eb50d535da17544
Log: Fix #76748: date format timezone abbreviations and changes not well documented
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 08:01:27 2024 UTC