#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    18
    Rep Power
    0

    Time conversion from my total time


    0.25 -15 Minutes
    0.50 -30 Minutes
    0.75 -45 Minutes
    1.00 -60 Minutes
    1.25 -75 Minutes


    as per above scenario I got total time as 100.25 in my text field. i have to convert as no of Day(s) no of hour(s) no of Minute(s) using java script


    can any one help on this

    Thank you
  2. #2
  3. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,997
    Rep Power
    9397
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    18
    Rep Power
    0

    i got solution ..can you help me another one


    i got it


    <script type = "text/javascript">

    var hours = 100.25;
    var days = Math.floor(hours/24);
    hrs = Math.floor(hours%24);
    var decimal = hours - Math.floor(hours);
    var minutes = Math.round(decimal * 60);

    document.getElementById("actualDays").value= +days+" Day(s) "+hrs+" Hour(s) "+minutes+" Minute(s)";


    </script>

    i am retuning this blow value (through ID) and i have displayed in text box in my form.
    but i need t dispaly as lable.can you help me

    document.getElementById("actualDays").value= +days+" Day(s) "+hrs+" Hour(s) "+minutes+" Minute(s)";


    my text box <input type="text" name="actualDays" id="actualDays" value="" size="30" />

IMN logo majestic logo threadwatch logo seochat tools logo