This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - How to get time difference (n number of times )

krish80 - Tuesday, December 8, 2009 8:36 PM:

Hi,
In my application I have created schedule chart, in that I am capturing the timing intervals of when the Job started, when paused, when resumed and when completed. For this purpose I have used four date controls in my form. I can get the time difference properly through the below code.

...
...
Dim pdrf_no As String = Me.getProperty("pdrf_no","")
Dim start_time As String = Me.getProperty("draft_start_time","")
Dim paused_time As String = Me.getProperty("draft_paused_time","")
Dim resumed_time As String = Me.getProperty("draft_resumed_time","")
Dim end_time As String = Me.getProperty("draft_end_time","")
….
….
….
Dim dFrom As Date
dFrom = System.Convert.ToDateTime(start_time)
Dim dpa As Date
dpa = System.Convert.ToDateTime(paused_time)
Dim dre As Date
dre = System.Convert.ToDateTime(resumed_time)
Dim dTo As Date
dTo = System.Convert.ToDateTime(end_time)

Dim TS1 As TimeSpan = dpa - dFrom
Dim TS2 As TimeSpan = dre - dpa
Dim TS3 As TimeSpan = dTo - dre

Dim TS As TimeSpan = TS1+TS3
Dim hour As Integer = TS.Hours
Dim mins As Integer = TS.Minutes
Dim secs As Integer = TS.Seconds
Dim timeDiff As String = ((hour.ToString("00") & ":") + mins.ToString("00") & ":") + secs.ToString("00")

updt.setProperty("total_hour",timeDiff)
…..
...
The above scenario is like:

Job Start Time…………….Job Paused Time……………Job Resumed Time……….Job End Time

My Request: How to capture N number of paused & resumed time. 

Like: 

Job Start…...Job Paused...…Job Resumed...…Job Paused...…Job Resumed…...Job Paused…...Job Resumed…...Job End

Please guide me how to do the above requirement.

Regards,
Krish



AbhishekSrivastava - Thursday, March 10, 2016 2:50 AM:

Hi Radha krishnan,

Can you please share your code for end time - start time.

For Ex:   14:00-13:00=1:00

 

Thank You

Abhishek Srivastava