Come convertire un oggetto Java Date in un oggetto JRuby Time?
-
07-07-2019 - |
Domanda
Usando JRuby, c'è un buon modo per convertire un oggetto Java Date in un oggetto JRuby Time? Sto usando l'ultima versione di JRuby (1.3.1) e Java SE 6.
Soluzione
Questo dovrebbe funzionare bene:
Time.at(java.util.Date.new.getTime/1000)
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow