Over a million developers have joined DZone.

Get Number Of Minutes From Hours (Simple Version)

·
// Get the number of minutes from a date object's timestamp


function FormatMinutesFromHours(dateObject) {
    // Get the decimal value of hours
    var decimalTime = dateObject.getHours() + (dateObject.getMinutes() / 60);
    // Multiply by 60 and round to get the correct number of minutes
    return Math.round(decimalTime * 60);
}
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}