Find sum of time in an array of time format hh:mm:ss2019 Community Moderator ElectionFind time average of hh:mm:ssCalculate relative time in C#How do I check if an array includes an object in JavaScript?How to append something to an array?How to get the current time in PythonWhat do 'real', 'user' and 'sys' mean in the output of time(1)?How to insert an item into an array at a specific index (JavaScript)?Loop through an array in JavaScriptHow to check if an object is an array?How do I remove a particular element from an array in JavaScript?For-each over an array in JavaScript?

Unable to get newly inserted Product's Id using After Plugin for Catalog Product save controller method

Why I don't get the wanted width of tcbox?

PTIJ: Where did Achashverosh's years wander off to?

Was World War I a war of liberals against authoritarians?

Would mining huge amounts of resources on the Moon change its orbit?

Weird lines in Microsoft Word

Help with identifying unique aircraft over NE Pennsylvania

If I cast the Enlarge/Reduce spell on an arrow, what weapon could it count as?

PTIJ: Which Dr. Seuss books should one obtain?

is this saw blade faulty?

Naïve RSA decryption in Python

Which partition to make active?

Does convergence of polynomials imply that of its coefficients?

How can an organ that provides biological immortality be unable to regenerate?

Why doesn't the fusion process of the sun speed up?

How can a new country break out from a developed country without war?

Gauss brackets with double vertical lines

When should a starting writer get his own webpage?

How old is Nick Fury?

Why is indicated airspeed rather than ground speed used during the takeoff roll?

Hot air balloons as primitive bombers

PTIJ: Why do we make a Lulav holder?

How to determine the greatest d orbital splitting?

How to test the sharpness of a knife?



Find sum of time in an array of time format hh:mm:ss



2019 Community Moderator ElectionFind time average of hh:mm:ssCalculate relative time in C#How do I check if an array includes an object in JavaScript?How to append something to an array?How to get the current time in PythonWhat do 'real', 'user' and 'sys' mean in the output of time(1)?How to insert an item into an array at a specific index (JavaScript)?Loop through an array in JavaScriptHow to check if an object is an array?How do I remove a particular element from an array in JavaScript?For-each over an array in JavaScript?










1















I have this code that works to find the sum properly for format hh:mm
I am having hard time converting this to format hh:mm:ss
Obviously everything should be rounded up correctly.



this is the format of the array i am looking for to work with but code obviously works only for ["00", "10"] as an example






const array = [
["00", "00", "09"],
["00", "00", "09"],
["00", "00", "04"],
["00", "00", "02"],
["00", "00", "21"],
["00", "00", "14"],
["00", "00", "26"],
["00", "00", "02"],
["00", "00", "14"],
["00", "00", "10"],
["00", "00", "48"],
["00", "00", "12"],
["00", "00", "09"],
["00", "00", "09"]
]

var mins = 0;
var hrs = 0;

if (array == null)
mins = Number(t1[1]) + Number(t2[1]);
hrs = Math.floor(parseInt(mins / 60));
hrs = Number(t1[0]) + Number(t2[0]) + hrs;
else
$.each(array, function(key)
mins += Number(array[key][1]);
hrs = Math.floor(parseInt(mins / 60));
hrs += Number(array[key][0]) + hrs;
);


console.log(mins, hrs)

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>





t1 and t2 in this case are just 2 separate values to be added together then there is an array of bunch of these. Both should work right.



please help me add properly seconds in here too.










share|improve this question



















  • 1





    If you're dealing with time, have a look at moment.js - it has all the bits you need. momentjs.com/docs

    – Rastalamm
    Mar 7 at 19:01











  • thank you for your suggestion but i am just asking to help me edit the code that i already have to work with seconds as well.. thanks

    – coder
    Mar 7 at 19:04











  • do you have some data in text form and the wanted result?

    – Nina Scholz
    Mar 7 at 19:05






  • 2





    btw, it looks like the last question without the average part.

    – Nina Scholz
    Mar 7 at 19:06











  • just updated. thanks for letting me know

    – coder
    Mar 7 at 19:13















1















I have this code that works to find the sum properly for format hh:mm
I am having hard time converting this to format hh:mm:ss
Obviously everything should be rounded up correctly.



this is the format of the array i am looking for to work with but code obviously works only for ["00", "10"] as an example






const array = [
["00", "00", "09"],
["00", "00", "09"],
["00", "00", "04"],
["00", "00", "02"],
["00", "00", "21"],
["00", "00", "14"],
["00", "00", "26"],
["00", "00", "02"],
["00", "00", "14"],
["00", "00", "10"],
["00", "00", "48"],
["00", "00", "12"],
["00", "00", "09"],
["00", "00", "09"]
]

var mins = 0;
var hrs = 0;

if (array == null)
mins = Number(t1[1]) + Number(t2[1]);
hrs = Math.floor(parseInt(mins / 60));
hrs = Number(t1[0]) + Number(t2[0]) + hrs;
else
$.each(array, function(key)
mins += Number(array[key][1]);
hrs = Math.floor(parseInt(mins / 60));
hrs += Number(array[key][0]) + hrs;
);


console.log(mins, hrs)

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>





t1 and t2 in this case are just 2 separate values to be added together then there is an array of bunch of these. Both should work right.



please help me add properly seconds in here too.










share|improve this question



















  • 1





    If you're dealing with time, have a look at moment.js - it has all the bits you need. momentjs.com/docs

    – Rastalamm
    Mar 7 at 19:01











  • thank you for your suggestion but i am just asking to help me edit the code that i already have to work with seconds as well.. thanks

    – coder
    Mar 7 at 19:04











  • do you have some data in text form and the wanted result?

    – Nina Scholz
    Mar 7 at 19:05






  • 2





    btw, it looks like the last question without the average part.

    – Nina Scholz
    Mar 7 at 19:06











  • just updated. thanks for letting me know

    – coder
    Mar 7 at 19:13













1












1








1








I have this code that works to find the sum properly for format hh:mm
I am having hard time converting this to format hh:mm:ss
Obviously everything should be rounded up correctly.



this is the format of the array i am looking for to work with but code obviously works only for ["00", "10"] as an example






const array = [
["00", "00", "09"],
["00", "00", "09"],
["00", "00", "04"],
["00", "00", "02"],
["00", "00", "21"],
["00", "00", "14"],
["00", "00", "26"],
["00", "00", "02"],
["00", "00", "14"],
["00", "00", "10"],
["00", "00", "48"],
["00", "00", "12"],
["00", "00", "09"],
["00", "00", "09"]
]

var mins = 0;
var hrs = 0;

if (array == null)
mins = Number(t1[1]) + Number(t2[1]);
hrs = Math.floor(parseInt(mins / 60));
hrs = Number(t1[0]) + Number(t2[0]) + hrs;
else
$.each(array, function(key)
mins += Number(array[key][1]);
hrs = Math.floor(parseInt(mins / 60));
hrs += Number(array[key][0]) + hrs;
);


console.log(mins, hrs)

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>





t1 and t2 in this case are just 2 separate values to be added together then there is an array of bunch of these. Both should work right.



please help me add properly seconds in here too.










share|improve this question
















I have this code that works to find the sum properly for format hh:mm
I am having hard time converting this to format hh:mm:ss
Obviously everything should be rounded up correctly.



this is the format of the array i am looking for to work with but code obviously works only for ["00", "10"] as an example






const array = [
["00", "00", "09"],
["00", "00", "09"],
["00", "00", "04"],
["00", "00", "02"],
["00", "00", "21"],
["00", "00", "14"],
["00", "00", "26"],
["00", "00", "02"],
["00", "00", "14"],
["00", "00", "10"],
["00", "00", "48"],
["00", "00", "12"],
["00", "00", "09"],
["00", "00", "09"]
]

var mins = 0;
var hrs = 0;

if (array == null)
mins = Number(t1[1]) + Number(t2[1]);
hrs = Math.floor(parseInt(mins / 60));
hrs = Number(t1[0]) + Number(t2[0]) + hrs;
else
$.each(array, function(key)
mins += Number(array[key][1]);
hrs = Math.floor(parseInt(mins / 60));
hrs += Number(array[key][0]) + hrs;
);


console.log(mins, hrs)

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>





t1 and t2 in this case are just 2 separate values to be added together then there is an array of bunch of these. Both should work right.



please help me add properly seconds in here too.






const array = [
["00", "00", "09"],
["00", "00", "09"],
["00", "00", "04"],
["00", "00", "02"],
["00", "00", "21"],
["00", "00", "14"],
["00", "00", "26"],
["00", "00", "02"],
["00", "00", "14"],
["00", "00", "10"],
["00", "00", "48"],
["00", "00", "12"],
["00", "00", "09"],
["00", "00", "09"]
]

var mins = 0;
var hrs = 0;

if (array == null)
mins = Number(t1[1]) + Number(t2[1]);
hrs = Math.floor(parseInt(mins / 60));
hrs = Number(t1[0]) + Number(t2[0]) + hrs;
else
$.each(array, function(key)
mins += Number(array[key][1]);
hrs = Math.floor(parseInt(mins / 60));
hrs += Number(array[key][0]) + hrs;
);


console.log(mins, hrs)

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>





const array = [
["00", "00", "09"],
["00", "00", "09"],
["00", "00", "04"],
["00", "00", "02"],
["00", "00", "21"],
["00", "00", "14"],
["00", "00", "26"],
["00", "00", "02"],
["00", "00", "14"],
["00", "00", "10"],
["00", "00", "48"],
["00", "00", "12"],
["00", "00", "09"],
["00", "00", "09"]
]

var mins = 0;
var hrs = 0;

if (array == null)
mins = Number(t1[1]) + Number(t2[1]);
hrs = Math.floor(parseInt(mins / 60));
hrs = Number(t1[0]) + Number(t2[0]) + hrs;
else
$.each(array, function(key)
mins += Number(array[key][1]);
hrs = Math.floor(parseInt(mins / 60));
hrs += Number(array[key][0]) + hrs;
);


console.log(mins, hrs)

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>






javascript time






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 8 at 6:16









adiga

11.3k62545




11.3k62545










asked Mar 7 at 19:00









codercoder

819




819







  • 1





    If you're dealing with time, have a look at moment.js - it has all the bits you need. momentjs.com/docs

    – Rastalamm
    Mar 7 at 19:01











  • thank you for your suggestion but i am just asking to help me edit the code that i already have to work with seconds as well.. thanks

    – coder
    Mar 7 at 19:04











  • do you have some data in text form and the wanted result?

    – Nina Scholz
    Mar 7 at 19:05






  • 2





    btw, it looks like the last question without the average part.

    – Nina Scholz
    Mar 7 at 19:06











  • just updated. thanks for letting me know

    – coder
    Mar 7 at 19:13












  • 1





    If you're dealing with time, have a look at moment.js - it has all the bits you need. momentjs.com/docs

    – Rastalamm
    Mar 7 at 19:01











  • thank you for your suggestion but i am just asking to help me edit the code that i already have to work with seconds as well.. thanks

    – coder
    Mar 7 at 19:04











  • do you have some data in text form and the wanted result?

    – Nina Scholz
    Mar 7 at 19:05






  • 2





    btw, it looks like the last question without the average part.

    – Nina Scholz
    Mar 7 at 19:06











  • just updated. thanks for letting me know

    – coder
    Mar 7 at 19:13







1




1





If you're dealing with time, have a look at moment.js - it has all the bits you need. momentjs.com/docs

– Rastalamm
Mar 7 at 19:01





If you're dealing with time, have a look at moment.js - it has all the bits you need. momentjs.com/docs

– Rastalamm
Mar 7 at 19:01













thank you for your suggestion but i am just asking to help me edit the code that i already have to work with seconds as well.. thanks

– coder
Mar 7 at 19:04





thank you for your suggestion but i am just asking to help me edit the code that i already have to work with seconds as well.. thanks

– coder
Mar 7 at 19:04













do you have some data in text form and the wanted result?

– Nina Scholz
Mar 7 at 19:05





do you have some data in text form and the wanted result?

– Nina Scholz
Mar 7 at 19:05




2




2





btw, it looks like the last question without the average part.

– Nina Scholz
Mar 7 at 19:06





btw, it looks like the last question without the average part.

– Nina Scholz
Mar 7 at 19:06













just updated. thanks for letting me know

– coder
Mar 7 at 19:13





just updated. thanks for letting me know

– coder
Mar 7 at 19:13












4 Answers
4






active

oldest

votes


















1














You could get the seconds add all values and build a new string of the sum.






function sumTime(t1, t2, array = []) 
var times = [3600, 60, 1],
sum = [t1, t2, ...array]
.map(s => s.split(':').reduce((s, v, i) => s + times[i] * v, 0))
.reduce((a, b) => a + b, 0);

return times
.map(t => [Math.floor(sum / t), sum %= t][0])
.map(v => v.toString().padStart(2, 0))
.join(':');


console.log(sumTime("01:02:03", "04:57:57"));
console.log(sumTime("00:00:09", "00:00:09", ["00:00:04", "00:00:02", "00:00:21", "00:00:14", "00:00:26", "00:00:02", "00:00:14", "00:00:10", "00:00:48", "00:00:12", "00:00:09", "00:00:09"]));





ES5






function sumTime(t1, t2, array) [])
.map(function (s)
return s
.split(':') // omit this line for splitted values ['02', '04', '45']
.reduce(function (s, v, i)
return s + times[i] * v;
, 0);
)
.reduce(function (a, b) return a + b; , 0);

return times
.map(function (t)
var value = Math.floor(sum / t);
sum %= t;
return value;
)
.map(function (v)
return v.toString().padStart(2, 0);
)
.join(':');



console.log(sumTime("01:02:03", null));
console.log(sumTime(null, "04:57:57"));
console.log(sumTime(null, null, ["01:02:03", "04:57:57"]));
console.log(sumTime("00:00:09", "00:00:09", ["00:00:04", "00:00:02", "00:00:21", "00:00:14", "00:00:26", "00:00:02", "00:00:14", "00:00:10", "00:00:48", "00:00:12", "00:00:09", "00:00:09"]));





With splitted arrays.






function sumTime(t1, t2, array) 
var times = [3600, 60, 1],
sum = [t1, t2].filter(Boolean).concat(array

console.log(sumTime(["01", "02", "03"], null));
console.log(sumTime(null, ["04", "57", "57"]));
console.log(sumTime(null, null, [["01", "02", "03"], ["04", "57", "57"]]));
console.log(sumTime(["00", "00", "09"], ["00", "00", "09"], [["00", "00", "04"], ["00", "00", "02"], ["00", "00", "21"], ["00", "00", "14"], ["00", "00", "26"], ["00", "00", "02"], ["00", "00", "14"], ["00", "00", "10"], ["00", "00", "48"], ["00", "00", "12"], ["00", "00", "09"], ["00", "00", "09"]]));








share|improve this answer

























  • can you please convert this into similar code but without =>

    – coder
    Mar 7 at 19:26











  • and make sure it works for array and separate t1 and t2 values. Your code for average worked great. so function would be function sumTime(t1, t2, array) and if array is empty then use values from t1 and t2

    – coder
    Mar 7 at 19:28












  • that is t1 abd t2?

    – Nina Scholz
    Mar 7 at 19:31











  • also...format that i pass the array in is in the description. .. i don't need to split anymore.. it is already split ["00", "00", "09"], so this array of 0 is hours, of 1 is min and of 2 is seconds

    – coder
    Mar 7 at 19:32












  • then omit split(':').

    – Nina Scholz
    Mar 7 at 19:34


















0














Like one of the comments mentioned, moment is a popular npm package for dealing with time. You can parse the times in your array data structure using the formatting options of moment:



const array = [
[0, 0, 9],
[0, 2, 3],
[1, 2, 3],
...
];

const dates = array.map((date) =>
return moment(`$date[0]-$date[1]-$date[2]`, 'hh-mm-ss');
// make sure you account for 12 or 24 hour clocks, not sure which you are using
);

const sum = dates.reduce((date, total) => return total.add(date); , moment.duration(0));





share|improve this answer






























    0














    It's nearly the same math, just applied one more time for seconds -> minutes.



    seconds = t1[2] + t2[2];
    mins = parseInt(seconds / 60);
    seconds = seconds % 60;
    mins += t1[1] + t2[1];
    hrs = parseInt(minutes / 60);
    mins = mins % 60;
    hrs += t1[0] + t2[0];


    I'm assuming you already know how to convert hh:mm:ss to an appropriate array by simply using split and Number, but just in case:



    t1 = time1.split(':').map(part => Number(part));
    t2 = time2.split(':').map(part => Number(part));





    share|improve this answer






























      0














      You could use a reducer function to total the corresponding array elements and then amend the result.



      var timeArrays = [
      ['00', '52', '00'], ['00', '08', '00'], ['00', '00', '40'],
      ['00', '00', '01'], ['00', '00', '20']
      ];

      function totalTimeAsString(timeArray)
      var result = ['00', '00', '00'];

      var reducer = function (acc, current)
      return [
      Number(acc[0]) + Number(current[0]),
      Number(acc[1]) + Number(current[1]),
      Number(acc[2]) + Number(current[2])
      ];
      ;

      var [hh, mm, ss] = timeArray.reduce(reducer, result);

      // seconds
      if (ss > 59)
      mm += Math.floor(ss / 60);

      ss = ss % 60;
      result[2] = ((ss < 10) ? '0' : '') + ss;

      // minutes
      if (mm > 59)
      hh += Math.floor(mm / 60);

      mm = mm % 60;
      result[1] = ((mm < 10) ? '0' : '') + mm;

      // hours
      result[0] = ((hh < 10) ? '0' : '') + hh;

      return result.join(':');


      console.log(totalTimeAsString(timeArrays));
      // "01:01:01"





      share|improve this answer






















        Your Answer






        StackExchange.ifUsing("editor", function ()
        StackExchange.using("externalEditor", function ()
        StackExchange.using("snippets", function ()
        StackExchange.snippets.init();
        );
        );
        , "code-snippets");

        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "1"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader:
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        ,
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













        draft saved

        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55051019%2ffind-sum-of-time-in-an-array-of-time-format-hhmmss%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        4 Answers
        4






        active

        oldest

        votes








        4 Answers
        4






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        1














        You could get the seconds add all values and build a new string of the sum.






        function sumTime(t1, t2, array = []) 
        var times = [3600, 60, 1],
        sum = [t1, t2, ...array]
        .map(s => s.split(':').reduce((s, v, i) => s + times[i] * v, 0))
        .reduce((a, b) => a + b, 0);

        return times
        .map(t => [Math.floor(sum / t), sum %= t][0])
        .map(v => v.toString().padStart(2, 0))
        .join(':');


        console.log(sumTime("01:02:03", "04:57:57"));
        console.log(sumTime("00:00:09", "00:00:09", ["00:00:04", "00:00:02", "00:00:21", "00:00:14", "00:00:26", "00:00:02", "00:00:14", "00:00:10", "00:00:48", "00:00:12", "00:00:09", "00:00:09"]));





        ES5






        function sumTime(t1, t2, array) [])
        .map(function (s)
        return s
        .split(':') // omit this line for splitted values ['02', '04', '45']
        .reduce(function (s, v, i)
        return s + times[i] * v;
        , 0);
        )
        .reduce(function (a, b) return a + b; , 0);

        return times
        .map(function (t)
        var value = Math.floor(sum / t);
        sum %= t;
        return value;
        )
        .map(function (v)
        return v.toString().padStart(2, 0);
        )
        .join(':');



        console.log(sumTime("01:02:03", null));
        console.log(sumTime(null, "04:57:57"));
        console.log(sumTime(null, null, ["01:02:03", "04:57:57"]));
        console.log(sumTime("00:00:09", "00:00:09", ["00:00:04", "00:00:02", "00:00:21", "00:00:14", "00:00:26", "00:00:02", "00:00:14", "00:00:10", "00:00:48", "00:00:12", "00:00:09", "00:00:09"]));





        With splitted arrays.






        function sumTime(t1, t2, array) 
        var times = [3600, 60, 1],
        sum = [t1, t2].filter(Boolean).concat(array

        console.log(sumTime(["01", "02", "03"], null));
        console.log(sumTime(null, ["04", "57", "57"]));
        console.log(sumTime(null, null, [["01", "02", "03"], ["04", "57", "57"]]));
        console.log(sumTime(["00", "00", "09"], ["00", "00", "09"], [["00", "00", "04"], ["00", "00", "02"], ["00", "00", "21"], ["00", "00", "14"], ["00", "00", "26"], ["00", "00", "02"], ["00", "00", "14"], ["00", "00", "10"], ["00", "00", "48"], ["00", "00", "12"], ["00", "00", "09"], ["00", "00", "09"]]));








        share|improve this answer

























        • can you please convert this into similar code but without =>

          – coder
          Mar 7 at 19:26











        • and make sure it works for array and separate t1 and t2 values. Your code for average worked great. so function would be function sumTime(t1, t2, array) and if array is empty then use values from t1 and t2

          – coder
          Mar 7 at 19:28












        • that is t1 abd t2?

          – Nina Scholz
          Mar 7 at 19:31











        • also...format that i pass the array in is in the description. .. i don't need to split anymore.. it is already split ["00", "00", "09"], so this array of 0 is hours, of 1 is min and of 2 is seconds

          – coder
          Mar 7 at 19:32












        • then omit split(':').

          – Nina Scholz
          Mar 7 at 19:34















        1














        You could get the seconds add all values and build a new string of the sum.






        function sumTime(t1, t2, array = []) 
        var times = [3600, 60, 1],
        sum = [t1, t2, ...array]
        .map(s => s.split(':').reduce((s, v, i) => s + times[i] * v, 0))
        .reduce((a, b) => a + b, 0);

        return times
        .map(t => [Math.floor(sum / t), sum %= t][0])
        .map(v => v.toString().padStart(2, 0))
        .join(':');


        console.log(sumTime("01:02:03", "04:57:57"));
        console.log(sumTime("00:00:09", "00:00:09", ["00:00:04", "00:00:02", "00:00:21", "00:00:14", "00:00:26", "00:00:02", "00:00:14", "00:00:10", "00:00:48", "00:00:12", "00:00:09", "00:00:09"]));





        ES5






        function sumTime(t1, t2, array) [])
        .map(function (s)
        return s
        .split(':') // omit this line for splitted values ['02', '04', '45']
        .reduce(function (s, v, i)
        return s + times[i] * v;
        , 0);
        )
        .reduce(function (a, b) return a + b; , 0);

        return times
        .map(function (t)
        var value = Math.floor(sum / t);
        sum %= t;
        return value;
        )
        .map(function (v)
        return v.toString().padStart(2, 0);
        )
        .join(':');



        console.log(sumTime("01:02:03", null));
        console.log(sumTime(null, "04:57:57"));
        console.log(sumTime(null, null, ["01:02:03", "04:57:57"]));
        console.log(sumTime("00:00:09", "00:00:09", ["00:00:04", "00:00:02", "00:00:21", "00:00:14", "00:00:26", "00:00:02", "00:00:14", "00:00:10", "00:00:48", "00:00:12", "00:00:09", "00:00:09"]));





        With splitted arrays.






        function sumTime(t1, t2, array) 
        var times = [3600, 60, 1],
        sum = [t1, t2].filter(Boolean).concat(array

        console.log(sumTime(["01", "02", "03"], null));
        console.log(sumTime(null, ["04", "57", "57"]));
        console.log(sumTime(null, null, [["01", "02", "03"], ["04", "57", "57"]]));
        console.log(sumTime(["00", "00", "09"], ["00", "00", "09"], [["00", "00", "04"], ["00", "00", "02"], ["00", "00", "21"], ["00", "00", "14"], ["00", "00", "26"], ["00", "00", "02"], ["00", "00", "14"], ["00", "00", "10"], ["00", "00", "48"], ["00", "00", "12"], ["00", "00", "09"], ["00", "00", "09"]]));








        share|improve this answer

























        • can you please convert this into similar code but without =>

          – coder
          Mar 7 at 19:26











        • and make sure it works for array and separate t1 and t2 values. Your code for average worked great. so function would be function sumTime(t1, t2, array) and if array is empty then use values from t1 and t2

          – coder
          Mar 7 at 19:28












        • that is t1 abd t2?

          – Nina Scholz
          Mar 7 at 19:31











        • also...format that i pass the array in is in the description. .. i don't need to split anymore.. it is already split ["00", "00", "09"], so this array of 0 is hours, of 1 is min and of 2 is seconds

          – coder
          Mar 7 at 19:32












        • then omit split(':').

          – Nina Scholz
          Mar 7 at 19:34













        1












        1








        1







        You could get the seconds add all values and build a new string of the sum.






        function sumTime(t1, t2, array = []) 
        var times = [3600, 60, 1],
        sum = [t1, t2, ...array]
        .map(s => s.split(':').reduce((s, v, i) => s + times[i] * v, 0))
        .reduce((a, b) => a + b, 0);

        return times
        .map(t => [Math.floor(sum / t), sum %= t][0])
        .map(v => v.toString().padStart(2, 0))
        .join(':');


        console.log(sumTime("01:02:03", "04:57:57"));
        console.log(sumTime("00:00:09", "00:00:09", ["00:00:04", "00:00:02", "00:00:21", "00:00:14", "00:00:26", "00:00:02", "00:00:14", "00:00:10", "00:00:48", "00:00:12", "00:00:09", "00:00:09"]));





        ES5






        function sumTime(t1, t2, array) [])
        .map(function (s)
        return s
        .split(':') // omit this line for splitted values ['02', '04', '45']
        .reduce(function (s, v, i)
        return s + times[i] * v;
        , 0);
        )
        .reduce(function (a, b) return a + b; , 0);

        return times
        .map(function (t)
        var value = Math.floor(sum / t);
        sum %= t;
        return value;
        )
        .map(function (v)
        return v.toString().padStart(2, 0);
        )
        .join(':');



        console.log(sumTime("01:02:03", null));
        console.log(sumTime(null, "04:57:57"));
        console.log(sumTime(null, null, ["01:02:03", "04:57:57"]));
        console.log(sumTime("00:00:09", "00:00:09", ["00:00:04", "00:00:02", "00:00:21", "00:00:14", "00:00:26", "00:00:02", "00:00:14", "00:00:10", "00:00:48", "00:00:12", "00:00:09", "00:00:09"]));





        With splitted arrays.






        function sumTime(t1, t2, array) 
        var times = [3600, 60, 1],
        sum = [t1, t2].filter(Boolean).concat(array

        console.log(sumTime(["01", "02", "03"], null));
        console.log(sumTime(null, ["04", "57", "57"]));
        console.log(sumTime(null, null, [["01", "02", "03"], ["04", "57", "57"]]));
        console.log(sumTime(["00", "00", "09"], ["00", "00", "09"], [["00", "00", "04"], ["00", "00", "02"], ["00", "00", "21"], ["00", "00", "14"], ["00", "00", "26"], ["00", "00", "02"], ["00", "00", "14"], ["00", "00", "10"], ["00", "00", "48"], ["00", "00", "12"], ["00", "00", "09"], ["00", "00", "09"]]));








        share|improve this answer















        You could get the seconds add all values and build a new string of the sum.






        function sumTime(t1, t2, array = []) 
        var times = [3600, 60, 1],
        sum = [t1, t2, ...array]
        .map(s => s.split(':').reduce((s, v, i) => s + times[i] * v, 0))
        .reduce((a, b) => a + b, 0);

        return times
        .map(t => [Math.floor(sum / t), sum %= t][0])
        .map(v => v.toString().padStart(2, 0))
        .join(':');


        console.log(sumTime("01:02:03", "04:57:57"));
        console.log(sumTime("00:00:09", "00:00:09", ["00:00:04", "00:00:02", "00:00:21", "00:00:14", "00:00:26", "00:00:02", "00:00:14", "00:00:10", "00:00:48", "00:00:12", "00:00:09", "00:00:09"]));





        ES5






        function sumTime(t1, t2, array) [])
        .map(function (s)
        return s
        .split(':') // omit this line for splitted values ['02', '04', '45']
        .reduce(function (s, v, i)
        return s + times[i] * v;
        , 0);
        )
        .reduce(function (a, b) return a + b; , 0);

        return times
        .map(function (t)
        var value = Math.floor(sum / t);
        sum %= t;
        return value;
        )
        .map(function (v)
        return v.toString().padStart(2, 0);
        )
        .join(':');



        console.log(sumTime("01:02:03", null));
        console.log(sumTime(null, "04:57:57"));
        console.log(sumTime(null, null, ["01:02:03", "04:57:57"]));
        console.log(sumTime("00:00:09", "00:00:09", ["00:00:04", "00:00:02", "00:00:21", "00:00:14", "00:00:26", "00:00:02", "00:00:14", "00:00:10", "00:00:48", "00:00:12", "00:00:09", "00:00:09"]));





        With splitted arrays.






        function sumTime(t1, t2, array) 
        var times = [3600, 60, 1],
        sum = [t1, t2].filter(Boolean).concat(array

        console.log(sumTime(["01", "02", "03"], null));
        console.log(sumTime(null, ["04", "57", "57"]));
        console.log(sumTime(null, null, [["01", "02", "03"], ["04", "57", "57"]]));
        console.log(sumTime(["00", "00", "09"], ["00", "00", "09"], [["00", "00", "04"], ["00", "00", "02"], ["00", "00", "21"], ["00", "00", "14"], ["00", "00", "26"], ["00", "00", "02"], ["00", "00", "14"], ["00", "00", "10"], ["00", "00", "48"], ["00", "00", "12"], ["00", "00", "09"], ["00", "00", "09"]]));








        function sumTime(t1, t2, array = []) 
        var times = [3600, 60, 1],
        sum = [t1, t2, ...array]
        .map(s => s.split(':').reduce((s, v, i) => s + times[i] * v, 0))
        .reduce((a, b) => a + b, 0);

        return times
        .map(t => [Math.floor(sum / t), sum %= t][0])
        .map(v => v.toString().padStart(2, 0))
        .join(':');


        console.log(sumTime("01:02:03", "04:57:57"));
        console.log(sumTime("00:00:09", "00:00:09", ["00:00:04", "00:00:02", "00:00:21", "00:00:14", "00:00:26", "00:00:02", "00:00:14", "00:00:10", "00:00:48", "00:00:12", "00:00:09", "00:00:09"]));





        function sumTime(t1, t2, array = []) 
        var times = [3600, 60, 1],
        sum = [t1, t2, ...array]
        .map(s => s.split(':').reduce((s, v, i) => s + times[i] * v, 0))
        .reduce((a, b) => a + b, 0);

        return times
        .map(t => [Math.floor(sum / t), sum %= t][0])
        .map(v => v.toString().padStart(2, 0))
        .join(':');


        console.log(sumTime("01:02:03", "04:57:57"));
        console.log(sumTime("00:00:09", "00:00:09", ["00:00:04", "00:00:02", "00:00:21", "00:00:14", "00:00:26", "00:00:02", "00:00:14", "00:00:10", "00:00:48", "00:00:12", "00:00:09", "00:00:09"]));





        function sumTime(t1, t2, array) [])
        .map(function (s)
        return s
        .split(':') // omit this line for splitted values ['02', '04', '45']
        .reduce(function (s, v, i)
        return s + times[i] * v;
        , 0);
        )
        .reduce(function (a, b) return a + b; , 0);

        return times
        .map(function (t)
        var value = Math.floor(sum / t);
        sum %= t;
        return value;
        )
        .map(function (v)
        return v.toString().padStart(2, 0);
        )
        .join(':');



        console.log(sumTime("01:02:03", null));
        console.log(sumTime(null, "04:57:57"));
        console.log(sumTime(null, null, ["01:02:03", "04:57:57"]));
        console.log(sumTime("00:00:09", "00:00:09", ["00:00:04", "00:00:02", "00:00:21", "00:00:14", "00:00:26", "00:00:02", "00:00:14", "00:00:10", "00:00:48", "00:00:12", "00:00:09", "00:00:09"]));





        function sumTime(t1, t2, array) [])
        .map(function (s)
        return s
        .split(':') // omit this line for splitted values ['02', '04', '45']
        .reduce(function (s, v, i)
        return s + times[i] * v;
        , 0);
        )
        .reduce(function (a, b) return a + b; , 0);

        return times
        .map(function (t)
        var value = Math.floor(sum / t);
        sum %= t;
        return value;
        )
        .map(function (v)
        return v.toString().padStart(2, 0);
        )
        .join(':');



        console.log(sumTime("01:02:03", null));
        console.log(sumTime(null, "04:57:57"));
        console.log(sumTime(null, null, ["01:02:03", "04:57:57"]));
        console.log(sumTime("00:00:09", "00:00:09", ["00:00:04", "00:00:02", "00:00:21", "00:00:14", "00:00:26", "00:00:02", "00:00:14", "00:00:10", "00:00:48", "00:00:12", "00:00:09", "00:00:09"]));





        function sumTime(t1, t2, array) 
        var times = [3600, 60, 1],
        sum = [t1, t2].filter(Boolean).concat(array

        console.log(sumTime(["01", "02", "03"], null));
        console.log(sumTime(null, ["04", "57", "57"]));
        console.log(sumTime(null, null, [["01", "02", "03"], ["04", "57", "57"]]));
        console.log(sumTime(["00", "00", "09"], ["00", "00", "09"], [["00", "00", "04"], ["00", "00", "02"], ["00", "00", "21"], ["00", "00", "14"], ["00", "00", "26"], ["00", "00", "02"], ["00", "00", "14"], ["00", "00", "10"], ["00", "00", "48"], ["00", "00", "12"], ["00", "00", "09"], ["00", "00", "09"]]));





        function sumTime(t1, t2, array) 
        var times = [3600, 60, 1],
        sum = [t1, t2].filter(Boolean).concat(array

        console.log(sumTime(["01", "02", "03"], null));
        console.log(sumTime(null, ["04", "57", "57"]));
        console.log(sumTime(null, null, [["01", "02", "03"], ["04", "57", "57"]]));
        console.log(sumTime(["00", "00", "09"], ["00", "00", "09"], [["00", "00", "04"], ["00", "00", "02"], ["00", "00", "21"], ["00", "00", "14"], ["00", "00", "26"], ["00", "00", "02"], ["00", "00", "14"], ["00", "00", "10"], ["00", "00", "48"], ["00", "00", "12"], ["00", "00", "09"], ["00", "00", "09"]]));






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 7 at 20:03

























        answered Mar 7 at 19:13









        Nina ScholzNina Scholz

        192k15104176




        192k15104176












        • can you please convert this into similar code but without =>

          – coder
          Mar 7 at 19:26











        • and make sure it works for array and separate t1 and t2 values. Your code for average worked great. so function would be function sumTime(t1, t2, array) and if array is empty then use values from t1 and t2

          – coder
          Mar 7 at 19:28












        • that is t1 abd t2?

          – Nina Scholz
          Mar 7 at 19:31











        • also...format that i pass the array in is in the description. .. i don't need to split anymore.. it is already split ["00", "00", "09"], so this array of 0 is hours, of 1 is min and of 2 is seconds

          – coder
          Mar 7 at 19:32












        • then omit split(':').

          – Nina Scholz
          Mar 7 at 19:34

















        • can you please convert this into similar code but without =>

          – coder
          Mar 7 at 19:26











        • and make sure it works for array and separate t1 and t2 values. Your code for average worked great. so function would be function sumTime(t1, t2, array) and if array is empty then use values from t1 and t2

          – coder
          Mar 7 at 19:28












        • that is t1 abd t2?

          – Nina Scholz
          Mar 7 at 19:31











        • also...format that i pass the array in is in the description. .. i don't need to split anymore.. it is already split ["00", "00", "09"], so this array of 0 is hours, of 1 is min and of 2 is seconds

          – coder
          Mar 7 at 19:32












        • then omit split(':').

          – Nina Scholz
          Mar 7 at 19:34
















        can you please convert this into similar code but without =>

        – coder
        Mar 7 at 19:26





        can you please convert this into similar code but without =>

        – coder
        Mar 7 at 19:26













        and make sure it works for array and separate t1 and t2 values. Your code for average worked great. so function would be function sumTime(t1, t2, array) and if array is empty then use values from t1 and t2

        – coder
        Mar 7 at 19:28






        and make sure it works for array and separate t1 and t2 values. Your code for average worked great. so function would be function sumTime(t1, t2, array) and if array is empty then use values from t1 and t2

        – coder
        Mar 7 at 19:28














        that is t1 abd t2?

        – Nina Scholz
        Mar 7 at 19:31





        that is t1 abd t2?

        – Nina Scholz
        Mar 7 at 19:31













        also...format that i pass the array in is in the description. .. i don't need to split anymore.. it is already split ["00", "00", "09"], so this array of 0 is hours, of 1 is min and of 2 is seconds

        – coder
        Mar 7 at 19:32






        also...format that i pass the array in is in the description. .. i don't need to split anymore.. it is already split ["00", "00", "09"], so this array of 0 is hours, of 1 is min and of 2 is seconds

        – coder
        Mar 7 at 19:32














        then omit split(':').

        – Nina Scholz
        Mar 7 at 19:34





        then omit split(':').

        – Nina Scholz
        Mar 7 at 19:34













        0














        Like one of the comments mentioned, moment is a popular npm package for dealing with time. You can parse the times in your array data structure using the formatting options of moment:



        const array = [
        [0, 0, 9],
        [0, 2, 3],
        [1, 2, 3],
        ...
        ];

        const dates = array.map((date) =>
        return moment(`$date[0]-$date[1]-$date[2]`, 'hh-mm-ss');
        // make sure you account for 12 or 24 hour clocks, not sure which you are using
        );

        const sum = dates.reduce((date, total) => return total.add(date); , moment.duration(0));





        share|improve this answer



























          0














          Like one of the comments mentioned, moment is a popular npm package for dealing with time. You can parse the times in your array data structure using the formatting options of moment:



          const array = [
          [0, 0, 9],
          [0, 2, 3],
          [1, 2, 3],
          ...
          ];

          const dates = array.map((date) =>
          return moment(`$date[0]-$date[1]-$date[2]`, 'hh-mm-ss');
          // make sure you account for 12 or 24 hour clocks, not sure which you are using
          );

          const sum = dates.reduce((date, total) => return total.add(date); , moment.duration(0));





          share|improve this answer

























            0












            0








            0







            Like one of the comments mentioned, moment is a popular npm package for dealing with time. You can parse the times in your array data structure using the formatting options of moment:



            const array = [
            [0, 0, 9],
            [0, 2, 3],
            [1, 2, 3],
            ...
            ];

            const dates = array.map((date) =>
            return moment(`$date[0]-$date[1]-$date[2]`, 'hh-mm-ss');
            // make sure you account for 12 or 24 hour clocks, not sure which you are using
            );

            const sum = dates.reduce((date, total) => return total.add(date); , moment.duration(0));





            share|improve this answer













            Like one of the comments mentioned, moment is a popular npm package for dealing with time. You can parse the times in your array data structure using the formatting options of moment:



            const array = [
            [0, 0, 9],
            [0, 2, 3],
            [1, 2, 3],
            ...
            ];

            const dates = array.map((date) =>
            return moment(`$date[0]-$date[1]-$date[2]`, 'hh-mm-ss');
            // make sure you account for 12 or 24 hour clocks, not sure which you are using
            );

            const sum = dates.reduce((date, total) => return total.add(date); , moment.duration(0));






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 7 at 19:08









            jakemingollajakemingolla

            50739




            50739





















                0














                It's nearly the same math, just applied one more time for seconds -> minutes.



                seconds = t1[2] + t2[2];
                mins = parseInt(seconds / 60);
                seconds = seconds % 60;
                mins += t1[1] + t2[1];
                hrs = parseInt(minutes / 60);
                mins = mins % 60;
                hrs += t1[0] + t2[0];


                I'm assuming you already know how to convert hh:mm:ss to an appropriate array by simply using split and Number, but just in case:



                t1 = time1.split(':').map(part => Number(part));
                t2 = time2.split(':').map(part => Number(part));





                share|improve this answer



























                  0














                  It's nearly the same math, just applied one more time for seconds -> minutes.



                  seconds = t1[2] + t2[2];
                  mins = parseInt(seconds / 60);
                  seconds = seconds % 60;
                  mins += t1[1] + t2[1];
                  hrs = parseInt(minutes / 60);
                  mins = mins % 60;
                  hrs += t1[0] + t2[0];


                  I'm assuming you already know how to convert hh:mm:ss to an appropriate array by simply using split and Number, but just in case:



                  t1 = time1.split(':').map(part => Number(part));
                  t2 = time2.split(':').map(part => Number(part));





                  share|improve this answer

























                    0












                    0








                    0







                    It's nearly the same math, just applied one more time for seconds -> minutes.



                    seconds = t1[2] + t2[2];
                    mins = parseInt(seconds / 60);
                    seconds = seconds % 60;
                    mins += t1[1] + t2[1];
                    hrs = parseInt(minutes / 60);
                    mins = mins % 60;
                    hrs += t1[0] + t2[0];


                    I'm assuming you already know how to convert hh:mm:ss to an appropriate array by simply using split and Number, but just in case:



                    t1 = time1.split(':').map(part => Number(part));
                    t2 = time2.split(':').map(part => Number(part));





                    share|improve this answer













                    It's nearly the same math, just applied one more time for seconds -> minutes.



                    seconds = t1[2] + t2[2];
                    mins = parseInt(seconds / 60);
                    seconds = seconds % 60;
                    mins += t1[1] + t2[1];
                    hrs = parseInt(minutes / 60);
                    mins = mins % 60;
                    hrs += t1[0] + t2[0];


                    I'm assuming you already know how to convert hh:mm:ss to an appropriate array by simply using split and Number, but just in case:



                    t1 = time1.split(':').map(part => Number(part));
                    t2 = time2.split(':').map(part => Number(part));






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Mar 7 at 19:10









                    IceMetalPunkIceMetalPunk

                    954716




                    954716





















                        0














                        You could use a reducer function to total the corresponding array elements and then amend the result.



                        var timeArrays = [
                        ['00', '52', '00'], ['00', '08', '00'], ['00', '00', '40'],
                        ['00', '00', '01'], ['00', '00', '20']
                        ];

                        function totalTimeAsString(timeArray)
                        var result = ['00', '00', '00'];

                        var reducer = function (acc, current)
                        return [
                        Number(acc[0]) + Number(current[0]),
                        Number(acc[1]) + Number(current[1]),
                        Number(acc[2]) + Number(current[2])
                        ];
                        ;

                        var [hh, mm, ss] = timeArray.reduce(reducer, result);

                        // seconds
                        if (ss > 59)
                        mm += Math.floor(ss / 60);

                        ss = ss % 60;
                        result[2] = ((ss < 10) ? '0' : '') + ss;

                        // minutes
                        if (mm > 59)
                        hh += Math.floor(mm / 60);

                        mm = mm % 60;
                        result[1] = ((mm < 10) ? '0' : '') + mm;

                        // hours
                        result[0] = ((hh < 10) ? '0' : '') + hh;

                        return result.join(':');


                        console.log(totalTimeAsString(timeArrays));
                        // "01:01:01"





                        share|improve this answer



























                          0














                          You could use a reducer function to total the corresponding array elements and then amend the result.



                          var timeArrays = [
                          ['00', '52', '00'], ['00', '08', '00'], ['00', '00', '40'],
                          ['00', '00', '01'], ['00', '00', '20']
                          ];

                          function totalTimeAsString(timeArray)
                          var result = ['00', '00', '00'];

                          var reducer = function (acc, current)
                          return [
                          Number(acc[0]) + Number(current[0]),
                          Number(acc[1]) + Number(current[1]),
                          Number(acc[2]) + Number(current[2])
                          ];
                          ;

                          var [hh, mm, ss] = timeArray.reduce(reducer, result);

                          // seconds
                          if (ss > 59)
                          mm += Math.floor(ss / 60);

                          ss = ss % 60;
                          result[2] = ((ss < 10) ? '0' : '') + ss;

                          // minutes
                          if (mm > 59)
                          hh += Math.floor(mm / 60);

                          mm = mm % 60;
                          result[1] = ((mm < 10) ? '0' : '') + mm;

                          // hours
                          result[0] = ((hh < 10) ? '0' : '') + hh;

                          return result.join(':');


                          console.log(totalTimeAsString(timeArrays));
                          // "01:01:01"





                          share|improve this answer

























                            0












                            0








                            0







                            You could use a reducer function to total the corresponding array elements and then amend the result.



                            var timeArrays = [
                            ['00', '52', '00'], ['00', '08', '00'], ['00', '00', '40'],
                            ['00', '00', '01'], ['00', '00', '20']
                            ];

                            function totalTimeAsString(timeArray)
                            var result = ['00', '00', '00'];

                            var reducer = function (acc, current)
                            return [
                            Number(acc[0]) + Number(current[0]),
                            Number(acc[1]) + Number(current[1]),
                            Number(acc[2]) + Number(current[2])
                            ];
                            ;

                            var [hh, mm, ss] = timeArray.reduce(reducer, result);

                            // seconds
                            if (ss > 59)
                            mm += Math.floor(ss / 60);

                            ss = ss % 60;
                            result[2] = ((ss < 10) ? '0' : '') + ss;

                            // minutes
                            if (mm > 59)
                            hh += Math.floor(mm / 60);

                            mm = mm % 60;
                            result[1] = ((mm < 10) ? '0' : '') + mm;

                            // hours
                            result[0] = ((hh < 10) ? '0' : '') + hh;

                            return result.join(':');


                            console.log(totalTimeAsString(timeArrays));
                            // "01:01:01"





                            share|improve this answer













                            You could use a reducer function to total the corresponding array elements and then amend the result.



                            var timeArrays = [
                            ['00', '52', '00'], ['00', '08', '00'], ['00', '00', '40'],
                            ['00', '00', '01'], ['00', '00', '20']
                            ];

                            function totalTimeAsString(timeArray)
                            var result = ['00', '00', '00'];

                            var reducer = function (acc, current)
                            return [
                            Number(acc[0]) + Number(current[0]),
                            Number(acc[1]) + Number(current[1]),
                            Number(acc[2]) + Number(current[2])
                            ];
                            ;

                            var [hh, mm, ss] = timeArray.reduce(reducer, result);

                            // seconds
                            if (ss > 59)
                            mm += Math.floor(ss / 60);

                            ss = ss % 60;
                            result[2] = ((ss < 10) ? '0' : '') + ss;

                            // minutes
                            if (mm > 59)
                            hh += Math.floor(mm / 60);

                            mm = mm % 60;
                            result[1] = ((mm < 10) ? '0' : '') + mm;

                            // hours
                            result[0] = ((hh < 10) ? '0' : '') + hh;

                            return result.join(':');


                            console.log(totalTimeAsString(timeArrays));
                            // "01:01:01"






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Mar 7 at 20:06









                            Dan NagleDan Nagle

                            1,9221817




                            1,9221817



























                                draft saved

                                draft discarded
















































                                Thanks for contributing an answer to Stack Overflow!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid


                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.

                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55051019%2ffind-sum-of-time-in-an-array-of-time-format-hhmmss%23new-answer', 'question_page');

                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

                                Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

                                2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived