How to convert a Java Date object to a JRuby Time object?

Using JRuby, is there a good way to convert a Java Date object to a JRuby Time object? I am using the latest version of JRuby (1.3.1) and Java SE 6.

+6
jruby
source share
1 answer

This should work fine:

Time.at(java.util.Date.new.getTime/1000) 
+18
source share

All Articles