views:

473

answers:

1

Is it possible in easy way to convert JRuby Time/DataTime/Data into java.util.Calendar including the timezone?

On #jruby I was given such code cal.set_time_in_millis(time.to_i) but I lost information about timezone in betwean. So the more specific question is how to convert the timezone but I prefered to ask more broad questin in case there is simpler way.

+1  A: 

I get known that the Time does not store timezone so what is returned by Time.now.zone is local timezone.

Therefore it is simple to convert to java.util.Data:

data = java.util.Date.new(date.to_i*1000)
Maciej Piechotka