How can I convert a timespan datatype to a long?
Assuming you use .NET, Use:
MyTimeSpan.Ticks()
and to convert back (sample in VB.NET, C# implementation is trivial nontheless):
MyTimeSpan = New TimeSpan(totalTicks)
Actually you must use
MyTimeSpan.Ticks;
instead
MyTimeSpan.Ticks();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With