Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 60
  • Last Modified:

Convert Minutes to Days,Hours and Minute

Dear Experts,

I need to convert minutes into days,hours and remaining minutes in JavaScript.
Please send me the examples.
0
Asrar Azmi
Asked:
Asrar Azmi
1 Solution
 
Henry JiaCommented:
How about this one?
function getDHM(value) {
    var days = Math.floor(value / 24 / 60),
          hours = Math.floor(value / 60) - days * 24,
          minutes = value - (days * 24 + hours) * 60;

   return { Days: days, Hours: hours, Minutes: minutes};
}

Open in new window

0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now