Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Get Number Of Minutes From Hours (Simple Version)

DZone's Guide to

Get Number Of Minutes From Hours (Simple Version)

·
Free Resource
// 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:

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}