Doc #74324 [NEW]: DateTimeZone supported timezone names

From: Date: Tue, 28 Mar 2017 08:12:13 +0000
Subject: Doc #74324 [NEW]: DateTimeZone supported timezone names
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-14548@lists.php.net to get a copy of this message
From:             graeme dot chapman at infinitycloud dot com
Operating system: Ubuntu
PHP version:      5.6.30
Package:          Date/time related
Bug Type:         Documentation Problem
Bug description:DateTimeZone supported timezone names

Description:
------------
---
From manual page: http://www.php.net/datetimezone.construct
---

The documentation states that the DateTimeZone constructor accepts 'One
of the supported timezone
names(http://php.net/manual/en/timezones.php).' 

However, it also appears to accept offset values. Unsure if this is
expected but undocumented behaviour, or a bug. In PHP 5.5.9 this throws
an exception. 

Test script:
---------------
var_dump(new DateTimeZone('+0200'));

Expected result:
----------------
Uncaught exception 'Exception' with message
'DateTimeZone::__construct(): Unknown or bad timezone (+0200)'

Actual result:
--------------
object(DateTimeZone)#1 (2) {
  ["timezone_type"]=>
  int(1)
  ["timezone"]=>
  string(6) "+02:00"
}

-- 
Edit bug report at https://bugs.php.net/bug.php?id=74324&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=74324&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=74324&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=74324&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=74324&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=74324&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=74324&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=74324&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=74324&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=74324&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=74324&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=74324&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=74324&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=74324&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74324&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=74324&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=74324&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=74324&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74324&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=74324&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=74324&r=mysqlcfg



Thread (5 messages)

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