#47382 [NEW]: DateTime::getOffset documentation unclear
From: antti dot salminen at gmail dot com
Operating system: Linux
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: DateTime::getOffset documentation unclear
Description:
------------
DateTime::getOffset is said to return the DST offset in the documentation.
This sounds like it will simply return 0 or 3600 depending on whether or
not DST is in effect for the given DateTime object. It actually returns the
full offset from GMT. Documentation should better reflect this or the
function be changed.
Reproduce code:
---------------
date_default_timezone_set('Europe/Helsinki');
$winter = new DateTime('2009-02-13 14:25:41');
echo $winter->getOffset();
Expected result:
----------------
0
Actual result:
--------------
7200
--
Edit bug report at http://bugs.php.net/?id=47382&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47382&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47382&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47382&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=47382&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47382&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=47382&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=47382&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=47382&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=47382&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=47382&r=support
Expected behavior: http://bugs.php.net/fix.php?id=47382&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=47382&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=47382&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=47382&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47382&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47382&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=47382&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=47382&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=47382&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=47382&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=47382&r=mysqlcfg
Thread (3 messages)
- antti dot salminen at gmail dot com