Mega Code Archive

 
Categories / Ruby / Time
 

You can see the difference in two Time objects by subtracting them

stop = Time.local( 2007, "jan", 30, 1, 15, 20 ) start = Time.local( 2008, "jan", 30, 1, 15, 20 ) puts stop - start