Converting hours to ticks

  • Thread starter Thread starter maflatoun
  • Start date Start date
How do I convert 6000 hours (int) to ticks?

Since a tick is 100 nanoseconds, I guess you multiply by 10000000 * 60
* 60.


Mattias
 
You can also use the TimeSpan structure

Dim ts as New TimeSpan(6000,0,0)
Dim ticks As Long = ts.Ticks
 
Or combine both of their techniques hehe

Dim ticks As Long = 6000 * TimeSpan.TicksPerHour
 
Mafatour,

In the way you have asked, you cannot, simple because of the fact that ticks
is in every system another entitity.

You have got from the others who wrote before me the conversion from the the
datetime.tick to the internal Net tick (long).
However that is not the same as the SQL DateTime tick or the ShortTime tick.

Just as addition.

Cor
 
Back
Top