A_Ma
(A Ma)
1
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
<angusma@attglobal.net> writes:
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:
Time.new
Time.new.usec
YS.
A_Ma
(A Ma)
3
"Yohanes Santoso" <ysantoso-rubytalk@dessyku.is-a-geek.org> wrote in message
news:87odv5hglj.fsf@dessyku.is-a-geek.org...
<angusma@attglobal.net> writes:
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:
Time.new
Time.new.usec
YS.
It works. Thanks a lot for your help.
A Ma