Mantis - Quercus
Viewing Issue Advanced Details
3737 major always 11-02-09 13:16 11-05-09 12:30
damien  
nam  
normal  
closed 4.0.2  
fixed  
none    
none 4.0.2  
0003737: date_timezone_set does not update date correctly
I discovered this bug when using Quercus with Drupal 6 and the Date plugin. The behaviour of date_timezone_set does not update the DateTime object correctly and resets the time of the object to the current time. This causes problems validating date submissions on Drupal forms, as the Date plugin changes the timezone to correct for daylight savings hours (and always gets the current date back, rather than the user submitted date). The date_timezone_set returns false, indicating failure, but there is no indication why the failure occurred.
I've tested under JDK1.6 on Mac OS X (10.5.8). I've attached an example Maven project with the jetty and resin plugins configure (I usually use the jetty plugin for development, and I wanted to see if there was some dependency on the resin application container). Start with either 'mvn jetty:run' or 'mvn resin:run'. The test output can be accessed at http://localhost:8080/date-test/. [^]
 date-test.tar.gz [^] (1,680 bytes) 11-02-09 13:16
 date-test.zip [^] (3,389 bytes) 11-03-09 11:55
 date-test-fixed.tar.gz [^] (1,688 bytes) 11-03-09 12:01
 date-test.tar [^] (11,264 bytes) 11-03-09 12:02

Notes
(0004278)
damien   
11-03-09 12:05   
Apologies, I've had some difficulties getting compressed files to upload properly. I've attached an uncompressed tar file (date-test.tar) that should work! The example PHP app outputs the results of conversions to different timezones using the old and new versions for DateTime manipulation. The output I see for the timezone converted times is the current time in the given timezone, and not the converted time of the original DateTime object.
(0004285)
nam   
11-05-09 12:30   
php/1947

Thanks for the thorough report. This is fixed for 4.0.2.