Hi Not sure if this is a bug or not. I am doing a sql query for time difference using the TIMEDIFF function. It works for all other but not when not when you are doing a time difference for start time 23:00:00 (11 PM night) and end time 00:30:00 (12 AM Midnight) if you take a look, the difference is 1.5 hours, but the sql tells me that the difference is 22 hours, 30 minutes Any solution to this? Thanx
You can tell that, because you know what this is all about, but neither MySQL or I can tell that, because we are missing date part. timediff(ex1, ex2) returns ex1 - ex2, ex1 and ex2 can be full datetime or time values. In your case function does not know that "00:30:00" is actualy time from the next day. Solution is to use full datetime values or to add 24 hours to "00:30:00".