#38263 [NEW]: date() is always UTC in sessionhandler->write and so on
From: zybersup at yahoo dot com
Operating system: Windows XP Professional
PHP version: 5.1.4
PHP Bug Type: Date/time related
Bug description: date() is always UTC in sessionhandler->write and so on
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 bug report at http://bugs.php.net/?id=38263&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38263&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38263&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38263&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38263&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=38263&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38263&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38263&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38263&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38263&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38263&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=38263&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=38263&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38263&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38263&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38263&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38263&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38263&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38263&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38263&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38263&r=mysqlcfg
Thread (4 messages)
- zybersup at yahoo dot com