angusma
7/31/2006 4:00:00 PM
I am new to Ruby and am trying to get the precise time (down to a fraction
of a second). For example, I did this:
require 'date'
now = DateTime.now
puts sprintf ("The current time is: %2d:%2d:%5.2f", now.hour, now.min,
now.sec+now.sec_fraction)
However, I discover that now.sec_fraction is always zero. Am I not using the
right object?
Thanks in advance for any help.
A Ma