Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6.6
-
Fix Version/s: JRuby 1.7.0.pre1
-
Component/s: Ruby 1.9.2
-
Labels:None
-
Environment:Windows 7 x64
>jruby -v
jruby 1.6.7 (ruby-1.9.2-p312) (2012-02-22 3e82bc8) (Java HotSpot(TM) Client VM 1.6.0_29) [Windows 7-x86-java]
-
Number of attachments :
Description
When I call Ruby method Time.now it shows wrong timezone. Actually we aren't changing to daylight anymore, starting this year.
At the same time Java's class Date.new shows correct timezone.
>jruby -e "puts Time.now" 2012-02-29 19:26:59 +0300
>jruby -e "include Java; import java.util.Date; import java.text.SimpleDateFormat; puts SimpleDateFormat.new(\"yyyy-MM-dd HH:mm:ss Z\").format Date.new" 2012-02-29 20:26:56 +0400
I tried to fix it in lib\ruby\1.9\date\format.rb, but this didn't help.
This is most likely due to the outdated TZ database (2010k) we ship. This is the version that joda-time 2.0 ships with.
I see that joda-time 2.1 is released a week ago. I will be updating the master branch to accommodate it. According to the release notes, this version now ships with 2011n. This may address the discrepancy you are seeing.
If it does not, then the fix is going to be very hard to come by.
As you might be aware, the Olson TZ database FTP server was taken down last year due to the ill-advised lawsuit. The lawsuit was withdrawn, but the FTP server remains down as of this writing. Without a newer version of the database, we are basically stuck (I'm sure you can put together the update and compile the TZ database - there is an ant task you can use to automate the compilation part).