Edit:. What version of MySQL are you using? It works fine on 5.0.22. I just fulfilled this request. see here
mysql> SELECT TIME_TO_SEC(TIMEDIFF('2000:01:01 00:00:00', '2001:01:01 00:00:00')); +---------------------------------------------------------------------+ | TIME_TO_SEC(TIMEDIFF('2000:01:01 00:00:00', '2001:01:01 00:00:00')) | +---------------------------------------------------------------------+ | -31622400 | +---------------------------------------------------------------------+ 1 row in set (0.00 sec)
Do you see here ? This could be a truncation problem, since the time range is much smaller than the date difference you have.
Original answer
Use this
SELECT TIMESTAMPDIFF(SECOND,'2000:01:01 00:00:00', '2001:01:01 00:00:00'); +
The problem is that you are trying to convert a negative time into a stopwatch. The permutation of the variables will complete the task.
SELECT TIME_TO_SEC(TIMEDIFF('2001:01:01 00:00:00','2000:01:01 00:00:00')); +
source share