how to get the number of milliseconds between two System.DateTime objects

  • Thread starter Thread starter Daniel
  • Start date Start date
D

Daniel

how to get the number of milliseconds between two System.DateTime objects
 
System.TimeSpan TS = new System.TimeSpan(startDate.Ticks-endDate.Ticks);
return TS.TotalMilliseconds
 
Hi Daniel,

use this

TimeSpan dt = DateTime.Now.Subtract( otherDateTime) );
timeinMillis = (long)dt.TotalMilliseconds;

regards
Daniel junges
 

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