Sijo Kg wrote:
I have two values like incidents.first.created_on and Time.now
bothe are of class Time Now I would like to get differnet between these
two in hours I gtried like
But getting wrong result…Could you please tell how I can do this?
Thanks in advance
Time.now-incidents.first.created_on will return you the number of
seconds in Numeric, that’s why you can’t call the method ‘hours’ on it.
I haven’t seen a method which would convert seconds in hours for you, if
there really isn’t one, you’ll have to make the convertion to hours