Add seconds (in fixnum format) to datetime, Rails

I need to pass a variable to my view with Time.now + @seconds in a time format (e.g. 12pm + 3600 seconds = 1:00 pm , which goes into the view).

Time.now + @seconds #seconds is a fixnum

does not work because "Time cannot be forced into Fixnum." How can I generate this simple result?

+3
source share
1 answer

Do not shut me down if this is wrong now, but when I did Rails, you just said Time.now + @seconds.seconds. Also@seconds.seconds.from_now

+6
source

Source: https://habr.com/ru/post/1767289/


All Articles