0

Simple timediff:

SELECT time_format(timediff('2014-04-24 09:11:37','2014-04-24 09:09:37'),'%H:%m:%s') as dif

Returns 00:00:00 . Im problably missing something stupid, my apoligies...

2
Contributors
4
Replies
9
Views
3 Years
Discussion Span
Last Post by riahc3
0

This does work BTW:

SELECT time_format(timediff('2014-04-24 09:11:37','2014-04-24 09:11:47'),'%H:%m:%S') as dif

It returns -00:00:10 like it should

0

Figured it out.

I have another question:

Would:

SELECT time_format(timediff('2014-04-25 09:11:00','2014-04-23 09:11:00'),'%H:%m:%S') as dif

Return

48:00:00

If not, how can I get it so it can return 48:00:00 ?

Thank you

0

I pasted your code into MySQL and it returned 48:00:00 as you desired

I didnt test the code, I just saw that %H limits it from 0-23

You are right. It works like I desired.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.