{"id":170,"date":"2020-10-12T11:46:59","date_gmt":"2020-10-12T11:46:59","guid":{"rendered":"https:\/\/barahasoft.com.np\/blog\/?post_type=codings&#038;p=170"},"modified":"2020-10-12T11:49:54","modified_gmt":"2020-10-12T11:49:54","slug":"kotlin-code-to-convert-milliseconds-to-seconds-and-other-units","status":"publish","type":"codings","link":"https:\/\/barahasoft.com.np\/blog\/codings\/kotlin-code-to-convert-milliseconds-to-seconds-and-other-units\/","title":{"rendered":"Kotlin code to convert milliseconds to seconds and other units"},"content":{"rendered":"\n<p>Converting milliseconds to seconds and other time unit is quiet easy  in kotlin. Here we will use an utility class. We import following package : <em>import java.util.concurrent.TimeUnit<\/em><\/p>\n\n\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\nvar milis = 9808350855\nvar sec = TimeUnit.MILLISECONDS.toSeconds(milis)\nvar min = TimeUnit.MILLISECONDS.toMinutes(milis)\n\n\n\n<\/pre>","protected":false},"featured_media":0,"parent":0,"template":"","tags":[52,53,54,55],"language":[36],"ctype":[40],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v15.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Kotlin code to convert milliseconds to seconds and other units - BS Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/barahasoft.com.np\/blog\/codings\/kotlin-code-to-convert-milliseconds-to-seconds-and-other-units\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Kotlin code to convert milliseconds to seconds and other units - BS Blog\" \/>\n<meta property=\"og:description\" content=\"Converting milliseconds to seconds and other time unit is quiet easy in kotlin. Here we will use an utility class. We import following package : import java.util.concurrent.TimeUnit\" \/>\n<meta property=\"og:url\" content=\"https:\/\/barahasoft.com.np\/blog\/codings\/kotlin-code-to-convert-milliseconds-to-seconds-and-other-units\/\" \/>\n<meta property=\"og:site_name\" content=\"BS Blog\" \/>\n<meta property=\"article:modified_time\" content=\"2020-10-12T11:49:54+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/barahasoft.com.np\/blog\/#website\",\"url\":\"https:\/\/barahasoft.com.np\/blog\/\",\"name\":\"BS Blog\",\"description\":\"Baraha Soft Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/barahasoft.com.np\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/barahasoft.com.np\/blog\/codings\/kotlin-code-to-convert-milliseconds-to-seconds-and-other-units\/#webpage\",\"url\":\"https:\/\/barahasoft.com.np\/blog\/codings\/kotlin-code-to-convert-milliseconds-to-seconds-and-other-units\/\",\"name\":\"Kotlin code to convert milliseconds to seconds and other units - BS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/barahasoft.com.np\/blog\/#website\"},\"datePublished\":\"2020-10-12T11:46:59+00:00\",\"dateModified\":\"2020-10-12T11:49:54+00:00\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/barahasoft.com.np\/blog\/codings\/kotlin-code-to-convert-milliseconds-to-seconds-and-other-units\/\"]}]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/barahasoft.com.np\/blog\/wp-json\/wp\/v2\/codings\/170"}],"collection":[{"href":"https:\/\/barahasoft.com.np\/blog\/wp-json\/wp\/v2\/codings"}],"about":[{"href":"https:\/\/barahasoft.com.np\/blog\/wp-json\/wp\/v2\/types\/codings"}],"wp:attachment":[{"href":"https:\/\/barahasoft.com.np\/blog\/wp-json\/wp\/v2\/media?parent=170"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/barahasoft.com.np\/blog\/wp-json\/wp\/v2\/tags?post=170"},{"taxonomy":"language","embeddable":true,"href":"https:\/\/barahasoft.com.np\/blog\/wp-json\/wp\/v2\/language?post=170"},{"taxonomy":"ctype","embeddable":true,"href":"https:\/\/barahasoft.com.np\/blog\/wp-json\/wp\/v2\/ctype?post=170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}