Solved

Convert Minutes to Days,Hours and Minute

Posted on 2014-11-10
1
50 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Using Quotation Marks in PHP This question (http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_28217211.html) seems to come up a lot for developers who are new to PHP.  And it got me thinking, "How can we explain the rule…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
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.

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now