1

How to total the minutes of the two dates? I mean I want to know the total minutes between from 2012-01-08 8:30 and 2012-01-09 14:11 using MySQL?

I have initiate_date and finalize_date columns in my table and I want to select them and display their total minutes.

kiritsuku
  • 52,365
  • 18
  • 112
  • 133
noob
  • 290
  • 5
  • 16

2 Answers2

8

I would suggest Timestamp difference

For example

TIMESTAMPDIFF(MINUTE, initiate_date, finalize_date)
Moseleyi
  • 2,254
  • 1
  • 18
  • 40
3
 SELECT (TIME_TO_SEC(end_time) - TIME_TO_SEC(start_time))/60 AS `minutes` 
Shahzad Barkati
  • 2,491
  • 6
  • 23
  • 32
Devendra
  • 1,826
  • 6
  • 29
  • 46