{"id":385,"date":"2012-06-07T17:25:02","date_gmt":"2012-06-07T17:25:02","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=385"},"modified":"2022-02-17T07:14:04","modified_gmt":"2022-02-17T07:14:04","slug":"duration","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/php\/date-and-time\/duration","title":{"rendered":"Duration"},"content":{"rendered":"<h4>Convert Seconds To Duration Time Format<\/h4>\n<pre><code>\r\n\t$seconds_input = $video_duration;\t\t\/\/The value in seconds (e.g. 1568.782)\r\n\t$hours = (int)(($minutes = (int)($seconds = (int)($milliseconds = (int)($seconds_input * 1000)) \/ 1000) \/ 60) \/ 60);\r\n\t$duration_string = $hours.':'.($minutes%60).':'.($seconds%60).((($milliseconds%1000) === 0) ? '' : '.'.rtrim($milliseconds%1000, '0'));\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Convert Seconds To Duration Time Format $seconds_input = $video_duration; \/\/The value in seconds (e.g. 1568.782) $hours = (int)(($minutes = (int)($seconds = (int)($milliseconds = (int)($seconds_input * 1000)) \/ 1000) \/ 60) \/ 60); $duration_string = $hours.&#8217;:&#8217;.($minutes%60).&#8217;:&#8217;.($seconds%60).((($milliseconds%1000) === 0) ? &#8221; : &#8216;.&#8217;.rtrim($milliseconds%1000, &#8216;0&#8217;));<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-385","post","type-post","status-publish","format-standard","hentry","category-date-and-time"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=385"}],"version-history":[{"count":4,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/385\/revisions"}],"predecessor-version":[{"id":1442,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/385\/revisions\/1442"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}