JRuby incorrectly/incompatibly handles "TZ" environment variable (Time spec
failures)
-------------------------------------------------------------------------------------
Key: JRUBY-1601
URL: http://jira.codehaus.org/browse/JRUBY-1601
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.x
Environment: Ubuntu Linux 7.10,
ruby 1.8.5 (2007-11-21 rev 4842) [i386-jruby1.1b1]
Reporter: Vladimir Sizikov
Attachments: time.diff
JRuby handles "TZ" env variable incompatibly with MRI.
JRuby can't handle right:
1. When TZ has no sign, like "PDT5":
MRI:
ENV["TZ"]="PDT5"; Time.now() ==> Wed Nov 21 15:23:56 -0500 2007
JRUBY:
ENV["TZ"]="PDT5"; Time.now() ==> Wed Nov 21 20:28:50 +0000 2007
(notice the +0000 instead of -0500)
2. When TZ has seconds, like "PDT+5:00:00"
MRI:
ENV["TZ"]="GMT+5:00:00"; Time.now() ==> Wed Nov 21 15:30:18 -0500 2007
But Ruby produces different results depending on whether seconds are present in
TZ or not:
ENV["TZ"]="GMT+5:00"; Time.now() ==> Thu Nov 22 01:31:06 +0500 2007
ENV["TZ"]="GMT+5:00:00"; Time.now() ==> Wed Nov 21 20:31:31 +0000 2007
3. JRuby doesn't take into accound that the sign in TZ is the opposite of the
sign in Java's TimeZone:
MRI:
ENV["TZ"]="GMT+5:00"; Time.now() ==> Wed Nov 21 15:27:24 -0500 2007
JRuby:
ENV["TZ"]="GMT+5:00"; Time.now() ==> Thu Nov 22 01:27:39 +0500 2007
(notice the + sign in the time zone)
These issues lead to 14 test failures in the Rubinius spec tests.
The proposed patch fixes all 3 mentioned problems.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email