Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Minor 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 :
      0

      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.

        Activity

        Hide
        Hiro Asari added a comment -

        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).

        Show
        Hiro Asari added a comment - 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).
        Hide
        Hiro Asari added a comment -

        Looks like 2011n has this information.

        $ TZ=Europe/Moscow jruby -ve 'p Time.now'
        jruby 1.7.0.dev (ruby-1.9.3-p139) (2012-02-29 548048b) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java]
        2012-02-29 21:48:23 +0400
        

        Resolving this now.

        Show
        Hiro Asari added a comment - Looks like 2011n has this information. $ TZ=Europe/Moscow jruby -ve 'p Time.now' jruby 1.7.0.dev (ruby-1.9.3-p139) (2012-02-29 548048b) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java] 2012-02-29 21:48:23 +0400 Resolving this now.
        Hide
        Anton Petrov added a comment -

        Yes, I saw. You are ahead of me.
        But I don't know how to apply patch. Your help would be appreciated.

        Show
        Anton Petrov added a comment - Yes, I saw. You are ahead of me. But I don't know how to apply patch. Your help would be appreciated.
        Hide
        Hiro Asari added a comment -

        http://ci.jruby.org/snapshots/master/ will have it tomorrow morning. Given that 1.6.x is shipping with joda-time 1.6.2, and this is a major version change for joda-time, I am afraid it won't go in there.

        You are welcome to tailor the commit https://github.com/jruby/jruby/commit/4d6035dad70ace2315bd16ffec3bdff09d739993 to the 1.6 branch and build your own 1.6.x.

        Show
        Hiro Asari added a comment - http://ci.jruby.org/snapshots/master/ will have it tomorrow morning. Given that 1.6.x is shipping with joda-time 1.6.2, and this is a major version change for joda-time, I am afraid it won't go in there. You are welcome to tailor the commit https://github.com/jruby/jruby/commit/4d6035dad70ace2315bd16ffec3bdff09d739993 to the 1.6 branch and build your own 1.6.x.
        Hide
        Anton Petrov added a comment -

        It helped. Thank you.

        Show
        Anton Petrov added a comment - It helped. Thank you.

          People

          • Assignee:
            Hiro Asari
            Reporter:
            Anton Petrov
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: