From: liber at iproom dot com Operating system: Windows XP PHP version: 5.2.0 PHP Bug Type: Date/time related Bug description: DateTimeZone::getOffset($object) result strange
Description: ------------ DateTime class already has a getOffset to returns DST offset. But DateTimeZone has a parameter of DateTime, the result still returns only the DateTimeZone DST offset itself ? Should not it returns the offset between the DateTimeZone and the given parameter of DateTime ? Reproduce code: --------------- $dateTimeZoneTaipei = new DateTimeZone("Asia/Taipei"); $dateTimeZoneJapan = new DateTimeZone("Asia/Tokyo"); $dateTimeTaipei = new DateTime("now", $dateTimeZoneTaipei); $dateTimeJapan = new DateTime("now", $dateTimeZoneJapan); $timeOffset = $dateTimeZoneJapan->getOffset($dateTimeTaipei); var_dump($timeOffset); Expected result: ---------------- int(3600) Actual result: -------------- int(32400) -- Edit bug report at http://bugs.php.net/?id=39805&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39805&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39805&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39805&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39805&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39805&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39805&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39805&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39805&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39805&r=support Expected behavior: http://bugs.php.net/fix.php?id=39805&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39805&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39805&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39805&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39805&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39805&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39805&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39805&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39805&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39805&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39805&r=mysqlcfg