Solved

Convert Minutes to Days,Hours and Minute

Posted on 2014-11-10
1
53 Views
Last Modified: 2015-01-17
Dear Experts,

I need to convert minutes into days,hours and remaining minutes in JavaScript.
Please send me the examples.
0
Comment
Question by:Asrar Azmi
1 Comment
 
LVL 1

Accepted Solution

by:
Henry Jia earned 500 total points
ID: 40432233
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question