php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38263 date() is always UTC in sessionhandler->write and so on
Submitted: 2006-07-30 17:14 UTC Modified: 2006-08-22 16:47 UTC
From: zybersup at yahoo dot com Assigned: iliaa (profile)
Status: Closed Package: Date/time related
PHP Version: 5.1.4 OS: Windows XP Professional
Private report: No CVE-ID: None
 [2006-07-30 17:14 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-30 17:27 UTC] zybersup at yahoo dot com
I have tried to use PHP 5.0.5 instead and my script works well.
 [2006-07-30 17:39 UTC] tony2001@php.net
Duplicate of bug #37968.
 [2006-07-30 18:53 UTC] zybersup at yahoo dot com
I am not sure it is the duplicate of that bug or not. Because the symptom and work around are totally different. Only part of my description saying about apache crash that is related and it is not main issue of this bug report. However, it may be caused by the same core code, only the developers can tell. I am waiting for the debugging.
 [2006-08-22 16:47 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 09:01:30 2024 UTC