I have tables with 2 columns of timestamp. My goal is to have the difference between those 2 timestamp columns, but the format should be DD HH MM.
Using date_diff function, I can get the time difference in minutes, but I'm stuck at what to do next. What I would like to have is table like below:
ID | Time 1 | Time 2 | datediff(minutes) | time difference |
---|---|---|---|---|
A | 2023-06-01 07:30:12 | 2023-06-12 10:31:54 | 16021 | 11d 3h 1m |
B | 2023-06-01 09:30:45 | 2023-06-01 10:31:50 | 61 | 0d 1h 1m |
Any idea how to do it in Athena/Presto? Thank you for the help