【发布时间】:2014-03-28 23:42:55
【问题描述】:
我需要在 MySQL 中找到以下日期的小时时差 - 我可以使用 Datediff 函数吗?
2014-01-01 07:27:21 和 2014-02-01 11:29:00
我尝试使用DATEDIFF(MINUTE,'2014-01-01 07:27:21','2014-01-01 11:29:00'),但显然 MySQL 出错了。
【问题讨论】:
-
你为什么不试试看?
-
我尝试使用 DATEDIFF(MINUTE,'2014-01-01 07:27:21','2014-01-01 11:29:00') 但显然 MySQL 出现错误。
-
标题的 Google 搜索结果排名靠前:answers.oreilly.com/topic/… 简洁地回答了这个问题。
-
TIMESTAMPDIFF(MINUTE,(From_unixtime(q.paid_date)),(From_unixtime(q.closed_date))))