This query will return the number of minutes past midnight.
declare @now datetime = getdate() declare @midnight datetime = CAST( FLOOR( CAST( @now AS FLOAT ) ) AS DATETIME ) select datediff(mi, @midnight,@now)
The code
CAST( FLOOR( CAST( "yourDateTimeHere" AS FLOAT ) ) AS DATETIME )
Converts any time until midnight. Use the datiff with the mi function to get the number of minutes past midnight.
Use online books for more detailed maths of time and time
RC_Cleland
source share