{"id":701,"date":"2013-06-25T07:47:37","date_gmt":"2013-06-25T07:47:37","guid":{"rendered":"http:\/\/codeatelier.wordpress.com\/?p=513"},"modified":"2013-06-25T07:47:37","modified_gmt":"2013-06-25T07:47:37","slug":"how-to-add-time-together-in-java","status":"publish","type":"post","link":"https:\/\/codethataint.com\/blog\/how-to-add-time-together-in-java\/","title":{"rendered":"How to Add Time together in Java"},"content":{"rendered":"<p><strong>Time to be Added together<\/strong><\/p>\n<pre>\nTimeWorked\n09:05:25\n09:30:15\n10:15:01\n08:19:49\n09:17:40\n<\/pre>\n<p><strong>Code<\/strong><\/p>\n<pre>\nint hour = 0;\nint minute = 0;\n\nfor() {\n    String[] rowtime= row[i].split(\":\");\n    hour += Integer.parseInt(rowtime[0]);\n    minute += Integer.parseInt(rowtime[1]);\n}\n\nhour += minute \/ 60;\nminute %= 60;\n\nString result = hour + \":\" + minute\n\nif(minute&lt;10)\n  Nmin = &quot;0&quot;+ String.valueOf(minute);\nelse\n  Nmin = String.valueOf(minute);\n\t\t\n String result = hour + &quot;:&quot; + Nmin;\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Time to be Added together TimeWorked 09:05:25 09:30:15 10:15:01 08:19:49 09:17:40 Code int hour = 0; int minute = 0; for() { String[] rowtime= row[i].split(&#8220;:&#8221;); hour += Integer.parseInt(rowtime[0]); minute += Integer.parseInt(rowtime[1]); } hour += minute \/ 60; minute %= 60; String result = hour + &#8220;:&#8221; + minute if(minute&lt;10) Nmin = &quot;0&quot;+ String.valueOf(minute); else Nmin&hellip; <a href=\"https:\/\/codethataint.com\/blog\/how-to-add-time-together-in-java\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-701","post","type-post","status-publish","format-standard","hentry","category-date-and-time"],"_links":{"self":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/701","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/comments?post=701"}],"version-history":[{"count":0,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/701\/revisions"}],"wp:attachment":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/media?parent=701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/categories?post=701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/tags?post=701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}