I have a time like
"estimatedTime": "2022-11-09T22:59:00Z"
as json, which is parsed into datetime and saved in the db (t.datetime "estimated_time").
I want to find the difference between this estimated time and the current time in hours.
Currently i am getting the current time using
Time.now.utc
which is giving me the current time as Time object.
Please suggest on how to solve this issue and find the difference between them. First i cant quite figure how the conversion from json to datetime will look like. Additionally i am also confused as to how this datetime will then to converted to time object to find the difference. I am new to rails and ruby so i am getting confused.
ruby 2.7.5p203 Rails 4.2.11
I have tried various functions but it has led to more confusion as to what should be done here.