codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  convert minutes into hours and minutes  DoctorGonzo at 10:56 on Monday, May 22, 2006
 

Hi guys,

Need help with a javascript / maths problem.

I have a field which contains a number of minutes.

I need to convert this into hours and minutes though.

If I simply divide the field by 60, this gives me a DECIMAL ie. 350 (mins) divided by 60 returns 5.83 hours... but what needs to be returned is 5 hours 50 minutes. (or 5:50, more specifically)

Can anyone help with this? I'm thinking I will pass the minutes value to some sort of function.....

Gonzo

  Re: convert minutes into hours and minutes  schuiazza at 09:52 on Tuesday, August 14, 2007
 

Hello,

Can u please send me the code for the above probelm, I am trying to convert minutes to hours and minutes.

i would appreciate if u could send it at my email schuiazza@yahoo.com

Thanks

  Re: convert minutes into hours and minutes  Flashley630 at 06:45 on Monday, May 19, 2008
 

Hey KesherCommunications

Thanks for posting that.

It helped me solve a visual basic application that i've been stumped on all day.



  Re: convert minutes into hours and minutes  MattoThePotatto at 07:43 on Wednesday, June 25, 2008
 

Hey.
350 minutes is 5 hours 50 minutes...
<script type="text/javascript">
var Hours = Math.floor(350/60);
var Minutes = 350%60;
var Time = Hours + ":" + Minutes;
...
</script>
.. That should give you the conversion of minutes to hours+minutes..

  Re: convert minutes into hours and minutes  samirlogin at 16:44 on Friday, April 02, 2010
 

Got expected result, Thanks








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
• Game:Colonization based with HTML5 Canvas and JavaScript
• Pointwise.GridGen.v15.18
• Global.Mapper.v15.2.3.b060614
• Geometric_Glovius_Pro_v3.6.1
• VERO.SurfCAM.v2014
• Schlumberger.Petrel.V2013.2
• Petrel.V2013.2
• Altair.HyperWorks.v12
• VoluMill.v6.1


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2014