Bug #77885 [NEW]: DateTime function is taking timezone in consideration and always considering se

From: Date: Fri, 12 Apr 2019 20:01:52 +0000
Subject: Bug #77885 [NEW]: DateTime function is taking timezone in consideration and always considering se
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220420@lists.php.net to get a copy of this message
From: vinodh dot basavani at darwinbox dot io Operating system: Debian GNU/Linux 9.8 (stretch) PHP version: 7.1.28 Package: PHP options/info functions Bug Type: Bug Bug description:DateTime function is taking timezone in consideration and always considering se Description: ------------ <?php $dt = new DateTime("1970-01-01 ".date("H:i:s")); $dt->setTimezone(new DateTimeZone('UTC')); echo $dt->format('r'); echo "\n"; $seconds = (int)$dt->getTimestamp(); echo date("H:i:s",$seconds); echo "\n"; ?> even if i am setting the timezone to UTC, it is taking only the server time. Expected result: ---------------- It should take the UTC time zone. Actual result: -------------- It should take the UTC time zone. -- Edit bug report at https://bugs.php.net/bug.php?id=77885&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77885&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77885&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77885&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=77885&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=77885&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=77885&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=77885&r=needscript Try newer version: https://bugs.php.net/fix.php?id=77885&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=77885&r=support Expected behavior: https://bugs.php.net/fix.php?id=77885&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=77885&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=77885&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=77885&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77885&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=77885&r=dst IIS Stability: https://bugs.php.net/fix.php?id=77885&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=77885&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=77885&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=77885&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=77885&r=mysqlcfg

« previous php.bugs (#220420) next »