calculate weeks/hours into min.

Discussion in 'JavaScript' started by scriptsy26, Oct 24, 2008.

Thread Status:
Not open for further replies.
  1. #1
    I'm looking for a (extra) script that can calculate weeks and hours into minutes.
    I have got the javascript that calculates the difference between times, but it is into weeks,days,hours,min,sec.
    and i like it to be only in minutes.

    So like this example.
    input 1 week and 0 days and 5 hours
    Calculate
    = 10380 minutes.

    If someone knows how to do this please post or pm me.

    I would like to thank all for your input.

    Thanks
    scriptsy26
     
    scriptsy26, Oct 24, 2008 IP
  2. rhoula

    rhoula Well-Known Member

    Messages:
    875
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    145
    #2
    Would you be willing to make a small donation if that is made for you :)
     
    rhoula, Oct 24, 2008 IP
  3. cont911

    cont911 Peon

    Messages:
    50
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    <script>
    function dateToMin(week, day, hour, min)
    {
    return week * 7 * 24 * 60
    + day * 24 * 60
    + hour * 60
    + min;
    }


    alert(dateToMin(1, 0, 5, 0));

    </script>
     
    cont911, Oct 24, 2008 IP
  4. cont911

    cont911 Peon

    Messages:
    50
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    sorry, rhoula, did not see your comment :)
     
    cont911, Oct 24, 2008 IP
  5. scriptsy26

    scriptsy26 Active Member

    Messages:
    274
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    83
    #5
    Thanks both of you. I'm satified with your help.
     
    scriptsy26, Oct 27, 2008 IP
Thread Status:
Not open for further replies.