The code is as follows
pickup_time = DateTime.parse(q[:payload]["pickup_time"])
=> Wed, 24 Apr 2024 00:38:00 +0000
created_at = q[:created_at]
=> Tue, 23 Apr 2024 03:53:45.874273000 UTC +00:00
I need to get the difference between pickup_time
and created_at
in hours.
I have tried
(pickup_time - q[:created_at] / 1.hour)
It outputs the following error
`method_missing': undefined method `/' for Tue, 23 Apr 2024 03:53:45.874273000 UTC +00:00:Time (NoMethodError)
Any idea on how to how to fix this?