How to convert days to milliseconds in VB.NET

1 Answer

0 votes
Imports System

Public Class Program
	Public Shared Function daysToMilliseconds(ByVal days As Integer) As Integer
        Return days * 24 * 60 * 60 * 1000
    End Function

    Public Shared Sub Main()
        Console.WriteLine(daysToMilliseconds(1))
        Console.WriteLine(daysToMilliseconds(2))
        Console.WriteLine(daysToMilliseconds(9))
    End Sub
End Class



' run:
'
' 86400000
' 172800000
' 777600000
'

 



answered Mar 3, 2022 by avibootz
...