Calculate timespan in JavaScript

前端 未结 7 1980
刺人心
刺人心 2021-01-01 21:48

I have a .net 2.0 ascx control with a start time and end time textboxes. The data is as follows:

txtStart.Text = 09/19/2008 07:00:00

txtEnd.Text = 09/19/200

7条回答
  •  有刺的猬
    2021-01-01 21:58

    I took what @PConroy did and added to it by doing the calculations for you. I also added the regex to make sure the time is part of the string to create the date object.

    
        
            
        
        
        
    
    

    This is pretty rough, since I coded it up pretty fast, but it works. I tested it out. The alert box will display 0010:21:00.00 (HHHH:MM:SS.SS). Basically all you need to do is get the values from your text boxes.

提交回复
热议问题