Converting hours to ticks

  • Thread starter Thread starter maflatoun
  • Start date Start date
M

maflatoun

Hi guys,

How do I convert 6000 hours (int) to ticks?

Thanks
Maz.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top