#38263 [Opn->Asn]: date() is always UTC in sessionhandler->write and so on
| From: | iliaa@php.net | Date: | Sun, 30 Jul 2006 17:32:33 +0000 |
| Subject: | #38263 [Opn->Asn]: date() is always UTC in sessionhandler->write and so on | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-100111@lists.php.net to get a copy of this message | ||
ID: 38263
Updated by: iliaa@php.net
Reported By: zybersup at yahoo dot com
-Status: Open
+Status: Assigned
Bug Type: Date/time related
Operating System: Windows XP Professional
PHP Version: 5.1.4
-Assigned To:
+Assigned To: iliaa
Previous Comments:
------------------------------------------------------------------------
[2006-07-30 17:27:16] zybersup at yahoo dot com
I have tried to use PHP 5.0.5 instead and my script works well.
------------------------------------------------------------------------
[2006-07-30 17:14:17] zybersup at yahoo dot com
Description:
------------
I set date.timezone in php.ini to 'Asia/Bangkok', and all calling to
the function date() is correct along the code running, except once I
call it in my session_handler->write() which UTC is always returned. I
can correct it by calling date_default_timezone_set in the method then
the returned date is correct.
By the way, I found my Apache will crash many times during the call to
function date().
Actually, my script works well for 2 years with any of PHP 4.x.x
Reproduce code:
---------------
- Setting the option date.timezone in php.ini to 'Asia/Bangkok'
- Call date() anywhere you want, the return is correct.
- Call date() in $a_session_handler->write(), the return is UTC.
- Add date_default_timezone_set() in $a_session_handler->write() before
calling date(), the return is correct.
Expected result:
----------------
date time in the time zone set
Actual result:
--------------
UTC time
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38263&edit=1