Quantcast
Channel: aras PLM community
Viewing all articles
Browse latest Browse all 1103

How to get time difference (n number of times )

$
0
0

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


Viewing all articles
Browse latest Browse all 1103

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>