Public Module MdlPublic
    Public Function SecToHMS(ByVal NbSec As Integer) As String
        Dim Tmp As String = ""
        'Secondes
        If (NbSec Mod 60) < 10 Then
            Tmp = ":0" + CStr(CInt(NbSec Mod 60))
        Else
            Tmp = ":" + CStr(CInt(NbSec Mod 60))
        End If
        NbSec = CInt(NbSec / 60)
        'Minutes
        If (NbSec Mod 60) < 10 Then
            Tmp = ":0" + CStr(CInt(NbSec Mod 60)) + Tmp
        Else
            Tmp = ":" + CStr(CInt(NbSec Mod 60)) + Tmp
        End If
        NbSec = CInt(NbSec / 60)
        'Heures et éventuellement jours
        If (NbSec Mod 24) < 10 And NbSec > 23 Then
            Tmp = CStr(CInt(NbSec / 24)) + ":0" + CStr(CInt(NbSec Mod 24)) + Tmp
        ElseIf NbSec > 23 Then
            Tmp = CStr(CInt(NbSec / 24)) + ":" + CStr(CInt(NbSec Mod 24)) + Tmp
        Else
            Tmp = CStr(CInt(NbSec Mod 24)) + Tmp
        End If
        'Retour de la valeur obtenue
        Return Tmp
    End Function
End Module
