How to calculate the time different between two columns(max value) : [the table in database look like this][1]


  [1]: https://i.stack.imgur.com/zJOsn.jpg

I want to calculate the time different between MAX(salinity) and MAX(Depth) on a day. How can I do it?

SELECT  `r`.`date` ,  `r`.`time` ,  `r`.`salinity` 
FROM  `samlae` r
INNER JOIN (

SELECT  `date` , MAX(  `salinity` ) AS  `maxsalinity` 
FROM  `samlae` 
GROUP BY  `date`
)t ON  `t`.`date` =  `r`.`date` 
AND  `t`.`maxsalinity` =  `r`.`salinity`

Thank you.