I have two masked TextBox controls and was wondering how I\'d go about getting the time in each one and then converting the difference into milliseconds. Like, say in tb1 I
Try the following:
DateTime dtStart; DateTime dtEnd; if (DateTime.TryParse( tb1.Text, out dtStart ) && DateTime.TryParse(tb2.Text, out dtEnd )) { TimeSpan ts = dtStart - dtEnd; double difference = ts.TotalMilliseconds; }