I have the following code and I want get all minutes from time type.
declare @time time
set @time = '01:30'
declare @minutes int
--select @minutes = convert time to minutes here
select @minutes -- @minutes == 90
Please help.
MINUTE() : The MySQL MINUTE() function is used for return the minute part of a datetime value. It can be between 0 to 59. When the datetime is passed in MINUTE() function then it will return the minute value .
In this way, I will get everything, but I only want to get total minute. For eg, if the time is 07:10:35 , I want 430 . How to achieve that? The value from the field is 01-01-2001 07:10:40 The result I want is 430 ((7*60)+10) only.
MySQL SUBTIME() Function The SUBTIME() function subtracts time from a time/datetime expression and then returns the new time/datetime.
The difference between @time
& midnight;
set @minutes = datediff(minute, '00:00:00', @time)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With