tags:

views:

38

answers:

1

Hey guys how can I convert a "timespan" datatype to "long"?

cheers psilos

+1  A: 

Assuming you use .NET, Use:

MyTimeSpan.Ticks()

and to convert back (sample in VB.NET, C# implementation is trivial nontheless):

MyTimeSpan = New TimeSpan(totalTicks)
M.A. Hanin
thnx a lot, it works fine
psilos