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

From: Date: Fri, 12 Apr 2019 20:40:49 +0000
Subject: Bug #77885 [Nab]: DateTime function is taking timezone in consideration and always considering se
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220427@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77885&edit=1 ID: 77885 Updated by: requinix@php.net Reported by: vinodh dot basavani at darwinbox dot io Summary: DateTime function is taking timezone in consideration and always considering se Status: Not a bug Type: Bug Package: PHP options/info functions Operating System: Debian GNU/Linux 9.8 (stretch) PHP Version: 7.1.28 Block user comment: N Private report: N New Comment: https://3v4l.org/FNmXJ Previous Comments: ------------------------------------------------------------------------ [2019-04-12 20:39:24] vinodh dot basavani at darwinbox dot io <?php echo date_default_timezone_get(); ?> Asia/Calcutta ------------------------------------------------------------------------ [2019-04-12 20:34:58] requinix@php.net What does date_default_timezone_get() return? ------------------------------------------------------------------------ [2019-04-12 20:33:24] vinodh dot basavani at darwinbox dot io No..its in IST time zone. ------------------------------------------------------------------------ [2019-04-12 20:32:25] requinix@php.net You know the default timezone in PHP is UTC, right? ------------------------------------------------------------------------ [2019-04-12 20:30:20] vinodh dot basavani at darwinbox dot io $dt = new DateTime("1970-01-01 ".date("H:i:s"), new DateTimeZone('UTC')); $seconds = (int)$dt->getTimestamp(); echo date("H:i:s",$seconds); This snippet works fine in earlier versions of php i.e it is not taking the server time zone. but when i updated to the specified version. it is always taking the server time and ignoring the timezone specified. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=77885 -- Edit this bug report at https://bugs.php.net/bug.php?id=77885&edit=1

« previous php.bugs (#220427) next »