question 202 Dates Numbers & Regex · easy
Fix the support response time
response_hours should say how many hours support took to answer a ticket. A ticket answered two hours after it was opened shows 22.0, and one answered after three days shows less than a day. Fix it.
Function
response_hours(opened_at, answered_at)Inputstimestamps like
2025-03-03 09:15; the answer is never before the openingReturnsthe hours from opening to answer, as a float (90 minutes is 1.5)
Examples
callresponse_hours('2025-03-03 09:15', '2025-03-03 11:15')returns2.0
callresponse_hours('2025-03-03 09:15', '2025-03-03 10:45')returns1.5