Hi Danny,
Please refer below Code.
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
TimeSpan timeSpan = new TimeSpan(20, 23, 20);
Response.Write(this.ConvertTimeToInt(timeSpan));
}
}
public long ConvertTimeToInt(TimeSpan input)
{
return input.Ticks;
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
Dim timeSpan As TimeSpan = New TimeSpan(20, 23, 20)
Response.Write(Me.ConvertTimeToInt(timeSpan))
End If
End Sub
Public Function ConvertTimeToInt(ByVal input As TimeSpan) As Long
Return input.Ticks
End Function
Screenshot