package com.develop.common.utils

object TimeUtil {

    fun getTimes(second: Int, dst: IntArray) {
        val h = (second / 3600)
        val m = second % 3600 / 60
        val s = second % 60
        dst[0] = h
        dst[1] = m
        dst[2] = s
    }

    fun formatTime(src: IntArray): String {
        val hStr = if (src[0] < 10) "0${src[0]}" else src[0].toString()
        val mStr = if (src[1] < 10) "0${src[1]}" else src[1].toString()
        val sStr = if (src[2] < 10) "0${src[2]}" else src[2].toString()
        return if (src[0] > 0) {
            "$hStr:$mStr"
        }else {
            "$mStr:$sStr"
        }
    }
}