I have this jQuery
function that returns the current time as the number of milliseconds since the epoch (Jan 1, 1970):
time = new Date().getTime();
Is there a way to do the same in Ruby?
Right now, I am using Ruby's Time.now.to_i
which works great but returns a 10-digit integer (number of seconds)
How can I get it to display the number of milliseconds, as in jQuery
?
Best Answer