20 lines
630 B
VB.net
20 lines
630 B
VB.net
Public Module Converters
|
|
|
|
ReadOnly dtLuaMinValue As New DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)
|
|
|
|
Public Function ConvertDateTimeToString(dtValue As DateTime) As String
|
|
If dtValue < dtLuaMinValue.AddDays(1) Then
|
|
Return ""
|
|
ElseIf dtValue > DateTime.Today Then
|
|
Return dtValue.ToString("T")
|
|
Else
|
|
Return dtValue.ToString("d") & " " & dtValue.ToString("T")
|
|
End If
|
|
End Function
|
|
|
|
Public Function ConvertDateTimeToLuaInteger(dtValue As DateTime) As Integer
|
|
Return Math.Floor((dtValue.ToUniversalTime - dtLuaMinValue).TotalSeconds)
|
|
End Function
|
|
|
|
End Module
|