A
A
aloky2018-05-10 13:58:47
Ruby on Rails
aloky, 2018-05-10 13:58:47

How to find out how many hours are left?

Time.now => 2018-05-10 13:57:58 +0300// Current date
"2018-05-10T19:24:31+0300" // Find how many hours are left from this date

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Demidenko, 2018-05-10
@Dem1

gem time_difference

TimeDifference.between(Time.parse('2018-05-10T19:24:31+0300'), Time.now).in_hours

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question