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

  • Thread starter Thread starter Daniel
  • Start date Start date
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
 
Back
Top