eZeeNow.com

it's your's

Convert Difference between 2 times into Milliseconds?

how to get difference between two date times into milliseconds?

DateTime dt1 = DateTime.Parse(maskedTextBox1.Text);
DateTime dt2 = DateTime.Parse(maskedTextBox2.Text);
TimeSpan span = dt2 - dt1;
int ms = (int)span.TotalMilliseconds;

Loading