Question

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

Was it helpful?

Solution

This should work fine:

Time.at(java.util.Date.new.getTime/1000)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top