How to convert a Java Date object into a JRuby Time object?
-
07-07-2019 - |
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.
Solution
This should work fine:
Time.at(java.util.Date.new.getTime/1000)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow