ADDTIME() return 24 hour time

前端 未结 1 1197
陌清茗
陌清茗 2021-01-25 09:48
SELECT ADDTIME(TIME(\'23:59:59\'), TIME(\'02:00:00\'));

This currently returns: \'25:59:59\'
I want it to return: \'01:59:

相关标签:
1条回答
  • 2021-01-25 10:06

    Not sure if that's the best solution, but it seems to work :

    SELECT TIME((ADDTIME(TIME('23:59:59'), TIME('02:00:00')))%(TIME('24:00:00')));

    0 讨论(0)
提交回复
热议问题