Convert Difference between 2 times into Milliseconds?

后端 未结 11 2162
梦毁少年i
梦毁少年i 2020-12-06 09:11

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

11条回答
  •  [愿得一人]
    2020-12-06 09:29

    Try:

    DateTime first;
    DateTime second;
    
    int milliSeconds = (int)((TimeSpan)(second - first)).TotalMilliseconds;
    

提交回复
热议问题