Time difference function

Is there a time difference function to get the time difference between ending time and starting time which are in HHMMSS format?
thanks

Hi katarnak,
you are right !
you have to use try/catch statement.
And if i want to put this code in a method and call it
from another class what shoudl be the return type of
this method?the ex i gave you print the result as a String
if you want to use it as a method do this :
public java.util.Date doDifference(java.util.Date dateStart, java.util.Date dateEnd) throws ParseException{
java.text.SimpleDateFormat dateFormat = new
java.text.SimpleDateFormat("hhmmss");
java.util.Date dateStart =
dateFormat.parse(strDateStart);
java.util.Date dateEnd =
dateFormat.parse(strDateEnd);
java.util.Date difference= new
java.util.Date(dateStart.getTime()-dateEnd.getTime());
return difference;
now the return type is java.util.Date !
when you use this method do :
java.util.Date dateDiffence;
try {
dateDifference = TheClassWhichContainsTheMethod.doDifference(YourDateStart, YourDateEnd) ;
catch (ParseException pe) {
pe.printStackTrace();
Badr.

Similar Messages

  • Standard function for returninf time difference in days and hours.

    Hello all,
                Can somebody tell me whether there exists some standard function module which can calculate the time difference and returns the calculated time in the form of days and hours ?
    e.g. the time difference between the date 1.12.2007 from 7.00 pm to the date 1.1.2008 till 9.00 pm is
    30 days  and 2 hours or 30 : 2.
    answer as soon as possible.
    Thanks and regards,
    me

    Thanks a lot ya..
    thats an absolutely correct solution to my problem.  )

  • Stopping a while loop using the time difference of two tick counts

    Hi Guys,
    I'm currently writing a code which test how long does it take for a formula node to perform its operation. The program uses a while loop to perform the calculation, and the program stops after calculating when tick count has reached 10 seconds. The program then displays the number of iterations it does in 10 seconds. 
    So initially I created 2 frames of sequence structure. In my first frame I have my initial tick count, and in my second frame I have my final tick count and the while loop. I used the subtract function and divide the output by 1000 to get the time difference. Then using the comparison function, I set if output > 10 then the program should stop, to do this I linked the output of the comparison function to the stop button inside the while loop. 
    However, when I tried to run the code, the program just didn't run. Hence I created a similar program which puts the last tick count in new frame sequence. When I ran this code, the program never stopped. 
    Do you guys have any idea what went wrong with my codes.
    Thank you!
    Erry
    Solved!
    Go to Solution.
    Attachments:
    1. Tick Count.vi ‏27 KB
    tickcoun2.vi ‏27 KB

    Dataflow!
    In both VI's the stop terminal of the while loop is controlled by a boolean whose source is ouside of the while loop.  So that loop will either run once, or run forever, depending on the value of the boolean that is calculated before the loop starts and shows up at the tunnel going into the loop.
    I would recommend looking at the online LabVIEW tutorials
    LabVIEW Introduction Course - Three Hours
    LabVIEW Introduction Course - Six Hours

  • Exchange Rate Differences function and when to use

    The company I am asking about is based in the US, but also has offices and transactions in Canada.  Does the Exchange Rate Differences function need to be run at month-end before finalizing the financials, in order to "re-value" the Canadian accounts, such as Accts Receivable, Accts Payable, Fixed Assets, etc. that may not have changed during the last month (no activity during the "current" month)?  The financials are expressed in US Currency.  Transactions during the month to the various Canadian accounts are "re-valued" at the time of the transaction entry, since the exchange rates are updated every day in the system.  We need a clear-cut idea of when the Exchange Rate Differences function should be run.

    I would say that you do need to do it. This is very important to ensure your account receivable control account (or payable) is revalued at the end of the month based on the new exchange rate.
    I know some companies do not revalue the balances as it is not required. I think, revaluating the balance makes sense as it will give you a true picture of your payable or receivable at the end of the month. This is also a good way of accruing your exchange rate loss/gain.
    Vincent

  • Number to time stamp function: criptic help

    Your help is VERY misleading.... it costed me hours...
    If you say that the time stamp is "time-zone-independent number of seconds that have elapsed since 12:00 a.m., Friday, January 1, 1904, Universal Time"  you should display it as it is or *please* say that the time stamp is calculated in UTC time but displayed in local time.
    In fact, if I want to convert 3600, I would expect to see 1:00 am 1/1/1904, but I see 6:00 pm 12/31/1903, because I am in Colorado....
    By the way... it is wrong anyway, because there is now Daylight Savings time, which puts CO at UTC-6, not UTC-7..... Why don't you just have it display UTC time and we can all figure out where we live??

    Did I say something like that?
    And in LabVIEW 8.6 the Date/Time Format functions have an option to select if you want to see local time or UTC. And believe me if LabVIEW would display by default UTC instead of local time, 99.999% of the users would complain in a way that NI would not be able to do other business than answering those complaints anymore.
    About the time zone difference you should probably check your Windows settings. LabVIEW is simply using whatever Windows believes is the timezone it is working in. You usually select that during installation of a Windows system and there are various options such as not letting Windows adjust for DST automatically and then you might have adjusted simply the timezone or something.
    Rolf Kalbermatter
    Message Edited by rolfk on 08-18-2009 09:32 PM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Time Difference Span Over Midnight

    I am trying to calculate time difference for things that happen before and after midnight...
    Example - Call Time of 23:58:22 and an Arrival Time of 00:02:50...
    Gets all screwed up with <cfset response = DateDiff("s", calltime,artime)>
    I need the final value in seconds...
    Can't seem to figure this one out...
    Thanx,
    Merle

    I'm going to try elaborate further and add some coding for any help to others...
    First things first... CFFORM
    Time Vaildation Errors on the seconds...
    <cfinput type="Text" name="WhateverTime" required="Yes" message="Please Enter Time (HH:MM:SS)" size=6 validate="time">
    It will not take 26:11:22 nor will it take 13:76:33 - but it would take 17:55:77 (obviously 77 is no good)
    This will accept the entry but error on Database Insertion/Validation...
    Here is code to force appropriate time entry - to avoid the user error - data entry problem...
    It forces only good numbers...
    <cfselect name="aiqtimeh" class=verd8>
       <option value="00">00</option>
       <option value="01">01</option>
       <option value="02">02</option>
       <option value="03">03</option>
       <option value="04">04</option>
       <option value="05">05</option>
       <option value="06">06</option>
       <option value="07">07</option>
       <option value="08">08</option>
       <option value="09">09</option>
       <option value="10">10</option>
       <option value="11">11</option>
       <option value="12">12</option>
       <option value="13">13</option>
       <option value="14">14</option>
       <option value="15">15</option>
       <option value="16">16</option>
       <option value="17">17</option>
       <option value="18">18</option>
       <option value="19">19</option>
       <option value="20">20</option>
       <option value="21">21</option>
       <option value="22">22</option>
       <option value="23">23</option>
    </cfselect> :
    <cfselect name="aiqtimem" class=verd8>
       <option value="00">00</option>
       <option value="01">01</option>
       <option value="02">02</option>
       <option value="03">03</option>
       <option value="04">04</option>
       <option value="05">05</option>
       <option value="06">06</option>
       <option value="07">07</option>
       <option value="08">08</option>
       <option value="09">09</option>
       <option value="10">10</option>
       <option value="11">11</option>
       <option value="12">12</option>
       <option value="13">13</option>
       <option value="14">14</option>
       <option value="15">15</option>
       <option value="16">16</option>
       <option value="17">17</option>
       <option value="18">18</option>
       <option value="19">19</option>
       <option value="20">20</option>
       <option value="21">21</option>
       <option value="22">22</option>
       <option value="23">23</option>
       <option value="24">24</option>
       <option value="25">25</option>
       <option value="26">26</option>
       <option value="27">27</option>
       <option value="28">28</option>
       <option value="29">29</option>
       <option value="30">30</option>
       <option value="31">31</option>
       <option value="32">32</option>
       <option value="33">33</option>
       <option value="34">34</option>
       <option value="35">35</option>
       <option value="36">36</option>
       <option value="37">37</option>
       <option value="38">38</option>
       <option value="39">39</option>
       <option value="40">40</option>
       <option value="41">41</option>
       <option value="42">42</option>
       <option value="43">43</option>
       <option value="44">44</option>
       <option value="45">45</option>
       <option value="46">46</option>
       <option value="47">47</option>
       <option value="48">48</option>
       <option value="49">49</option>
       <option value="50">50</option>
       <option value="51">51</option>
       <option value="52">52</option>
       <option value="53">53</option>
       <option value="54">54</option>
       <option value="55">55</option>
       <option value="56">56</option>
       <option value="57">57</option>
       <option value="58">58</option>
       <option value="59">59</option>  
    </cfselect> :
    <cfselect name="aiqtimes" class=verd8>
       <option value="00">00</option>
       <option value="01">01</option>
       <option value="02">02</option>
       <option value="03">03</option>
       <option value="04">04</option>
       <option value="05">05</option>
       <option value="06">06</option>
       <option value="07">07</option>
       <option value="08">08</option>
       <option value="09">09</option>
       <option value="10">10</option>
       <option value="11">11</option>
       <option value="12">12</option>
       <option value="13">13</option>
       <option value="14">14</option>
       <option value="15">15</option>
       <option value="16">16</option>
       <option value="17">17</option>
       <option value="18">18</option>
       <option value="19">19</option>
       <option value="20">20</option>
       <option value="21">21</option>
       <option value="22">22</option>
       <option value="23">23</option>
       <option value="24">24</option>
       <option value="25">25</option>
       <option value="26">26</option>
       <option value="27">27</option>
       <option value="28">28</option>
       <option value="29">29</option>
       <option value="30">30</option>
       <option value="31">31</option>
       <option value="32">32</option>
       <option value="33">33</option>
       <option value="34">34</option>
       <option value="35">35</option>
       <option value="36">36</option>
       <option value="37">37</option>
       <option value="38">38</option>
       <option value="39">39</option>
       <option value="40">40</option>
       <option value="41">41</option>
       <option value="42">42</option>
       <option value="43">43</option>
       <option value="44">44</option>
       <option value="45">45</option>
       <option value="46">46</option>
       <option value="47">47</option>
       <option value="48">48</option>
       <option value="49">49</option>
       <option value="50">50</option>
       <option value="51">51</option>
       <option value="52">52</option>
       <option value="53">53</option>
       <option value="54">54</option>
       <option value="55">55</option>
       <option value="56">56</option>
       <option value="57">57</option>
       <option value="58">58</option>
       <option value="59">59</option>  
    </cfselect>
    So here lies the orignal problem...
    Data entry for the report is by hand...
    So it is not done automatically...
    A CreateTime Now() will not work for any entered time...
    As it might be a report from a week ago... Or as related spans across midnight...
    With this reporting system - there is no real chance of moving out further than 1 day - an incident is mitigated without spanning several days...
    If times are all lined up properly - and not spanning over midnight - no problem...
    ie:
    <cfif calltime LTE ConcTime>
    <cfset callduration = DateDiff("s", calltime,conctime)> - (forgive the different time notes calltime / enrtime - there are several that are being tracked/used)
    </cfif>
    <cfif calltime GTE ConcTime>
    <cfset sec=DateDiff("s",calltime,conctime)>
    <cfset days=int(sec/86400)>
    <cfset hours=int((sec-(days*86400))/3600)>
    <cfset minutes=int((sec-(days*86400)-(hours*3600))/60)>
    <cfset seconds=(sec-(days*86400)-(hours*3600)-(minutes*60))>
    <cfset callduration=((hours*60*60)+(minutes*60)+seconds)>
    </cfif>
    If Call time is Less ThanConclusion Time - Works fine... Dandy - if on same day...
    If not - GTE code is invoked...
    Took someone to figure out the math etc...
    From the Forum - if u are passing the dates...
    <cfset oneDateTime = createDateTime(2011,04,23,09,35,26)>
    <cfset twoDateTime = createDateTime(2011,04,24,12,15,13)>
    <cfoutput>#dateDiff("s",oneDateTime,twoDateTime)#</cfoutput>
    I'm not passing the dates - and would have to create the same
    <cfif calltime LTE ConcTime> etc...
    or
    <cfif calltime GTE ConcTime> etc...
    To start manipulating the date functions...
    So it is half a dozen of one or another...
    Hopefully this helps anyone with a similar problem...
    Merle

  • FM to find time difference

    Hi Experts,
    Is there any function module to find time difference between two given time.
    Thanks
    RR

    try using this 1.
    SD_CALC_DURATION_FROM_DATETIME

  • Date formats-time difference

    Hi,
    Any function module which can give the date and time difference if i input the date and time in the following format
    20090322       (date)
    20090321       (date)
    040004 (time)
    040000 (time)
    I had checked the other FM's but those are not in synch with the date format I am giving.Do anyone here know about a FM which can give the time difference even if we input the date and time in the above format.
    Format is the problem I am facing.
    Thanks,

    Hi Folks,
    I just want to avoid all the below computations and expecting to get the result irrespective of whichever the date format is,ie a function module which gives me the time difference irrespective of the date format that is fed as input.Seems it is not possible.
    data:date1(08) type C value '20090322',
         date2(08) type c value '20090322',
         time1(08) type c value '060648',
         time2(08) type c value '062403',
         date3(08) type C,
         date4(08) type c,
         time3(08) type c,
         time4(08) type c,
         temp1(08) type C,
         temp2(08) type c,
         temp3(08) type c,
         temp4(08) type c,
         temp5(08) type C,
         temp6(08) type c,
         temp7(08) type c,
         temp8(08) type c,
         temp9(08) type c,
         temp10(08) type c,
         temp11(08) type c,
         temp12(08) type c,
         gpdt type d,
         gptm type t,
         smsdt type d,
         smstm type t,
         e_tdiff type cva_time,
         v_diff type cva_time,
         e_days type i.
    temp1 = date1+0(4). "year
    temp2 = date1+4(2)."month
    temp3 = date1+6(2). "date
    temp4 = time1+0(2)."hrs
    temp5 = time1+2(2)."mins
    temp6 = time1+4(2)."secs
    temp7 = date2+0(4). "year
    temp8 = date2+4(2)."month
    temp9 = date2+6(2). "date
    temp10 = time2+0(2)."hrs
    temp11 = time2+2(2)."mins
    temp12 = time2+4(2)."secs
    concatenate: temp3  temp2  temp1 into gpdt,
                  temp9  temp8  temp7 into smsdt,
                  temp4  temp5  temp6 into gptm,
                  temp10  temp11  temp12 into smstm.
    CALL FUNCTION 'SCOV_TIME_DIFF'
      EXPORTING
        im_date1                    = gpdt
        im_date2                    = smsdt
        im_time1                    = gptm
        im_time2                    = smstm
    IMPORTING
       EX_DAYS                     = e_days
       EX_TIME                     = e_tdiff
    * EXCEPTIONS
    *   START_LARGER_THAN_END       = 1
    *   OTHERS                      = 2
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    write:/ e_tdiff,
            e_days.
    Thanks,

  • Time difference in inlclueding millisenconds

    I am trying to get the time difference in millisends.
    currently i am using following logic and found it is not giving accurate result.
    java.util.Date d1 = new java.util.Date();
    java.text.SimpleDateFormat f1 = new java.text.SimpleDateFormat("HH:mm:ss SSSSSSSSSSSSS");
    Date today1;
    String dateOut1;
    DateFormat dateFormatter1;
    // DateFormat formatter;
    Locale currentLocale1 = new Locale("en", "US");
    dateFormatter1 = DateFormat.getDateInstance(DateFormat.DEFAULT, currentLocale1);
    today1 = new Date();
    double sec = today1.getSeconds();
    System.out.println("nano secnonds : "+today1.getTime()+"<==="+today.getTime());
    System.out.println("milli sec : "+today1.getTime()+"<==="+today1.getTime()/1000000);
    System.out.println("date : "+today1.getDate()+"<==="+today.getDate());
    System.out.println("hours : "+today1.getHours()+"<==="+today.getHours());
    int min1 = today1.getMinutes() - today.getMinutes();
    System.out.println("difference min : "+min1);
    int sec1 = today1.getSeconds() - today.getSeconds();
    System.out.println("difference seconds : "+sec1);
    long time1 = today1.getTime()- today.getTime();
    System.out.println("difference time: "+time1);
    System.out.println("date difference : "+today1.compareTo(today)+"<====");
    dateOut1 = dateFormatter1.format(today1);
    long leftVal =0;
    int seconds = sec1 - 1;
    long timeval = 1000 - time1;
    System.out.println("timeval : "+timeval+"<===");
    if (time1 > 1000)
    leftVal = 1000 - time1;
    seconds = sec1;
    else
    leftVal = time1;
    seconds = sec1;
    Can anyone help in getting the time difference in hours, minutes, senconds and milliseconds
    Sumanth

    Could you please tell me is there any function which can simply returns me the time diffrence,That is the time difference.
    If you want to display the difference in a different format then do so....
    long time1 = ....
    long timesecs = time1/1000;
    long hours = timesecs/3600;
    long minutes = (timesecs - hours * 3600)/60;
    long secs = (timesecs - hours * 3600 - minutes * 60);
    long millis = time1 % 1000;
    Please keep in mind that the above is for display purposes the real difference is in time1.

  • Time Difference with Desktop Intelligence XI

    Post Author: tknight
    CA Forum: Desktop Intelligence Reporting
    I have 2 date time fields
    Starttime: = mm/dd/yyyy HH:MM:SS AM/PM
    Stoptime: = mm/dd/yyyy HH:MM:SS AM/PM
    I would like to compare the actual time difference between them.  Unfortunately Daysbetween() doesn't cut it because it returns an integer for the actual days between.  I need the number of hours/minutes. 
    For Example:
    Starttime = 03/27/2008 01:00:00 PM
    Stoptime = 03/27/2008 01:15:00 PM
    =Daysbetween(Starttime,Stoptime) returns "0"
    I need my variable to return eith 15 minutes or 0:15  (read 0 hours and 15 minutes).  Any thoughts?

    Post Author: jsanzone
    CA Forum: Desktop Intelligence Reporting
    tknight,
    There is no function for minutes that is comparable to DaysBetween, so you'll have to perform the work of "minutes between" in SQL using Designer....

  • How to find the time difference..?

    HI
    How to find the time difference between two times
    for Example
    the difference between '24/10/2005 8:25:00 PM' and '25/10/2005 5:20:00 AM'
    is 8.55
    Kris

    This is a procedure taht do the job
    CREATE OR REPLACE FUNCTION Diff_Time
         LD$Date_Deb IN DATE DEFAULT SYSDATE
         ,LD$Date_Fin IN DATE DEFAULT SYSDATE
         ,LN$JJ       OUT PLS_INTEGER
         ,LN$HH       OUT PLS_INTEGER
         ,LN$MI       OUT PLS_INTEGER
         ,LN$SS       OUT PLS_INTEGER
      ) RETURN NUMBER
    IS
      dif   NUMBER ;
    BEGIN
      IF LD$Date_Fin < LD$Date_Deb THEN
         RETURN ( -1 ) ;
      END IF ;
      SELECT  LD$Date_Fin - LD$Date_Deb INTO dif  FROM dual ;
      SELECT  TRUNC ( LD$Date_Fin - LD$Date_Deb)  INTO LN$JJ  FROM dual ;
      SELECT  TRUNC ( (LD$Date_Fin - LD$Date_Deb) * 24) -  ( LN$JJ * 24 ) INTO LN$HH FROM dual ;
      SELECT  TRUNC ( (LD$Date_Fin - LD$Date_Deb) * 1440) - ( (LN$HH * 60) + ( LN$JJ * 1440) ) INTO LN$MI FROM dual ;
      SELECT  TRUNC ( (LD$Date_Fin - LD$Date_Deb) * 86400) - ( (LN$MI * 60) + (LN$HH * 3600) + ( LN$JJ * 3600 * 24 ) ) INTO LN$SS FROM dual ;
      RETURN( dif ) ;
    END ;
    /You may have to modify it to fit your own requirement.
    Francois

  • How to calculate the % of time difference between different state

    Hi there,
    The below query returns the follwoign outptut. I need to calculate the % of time period that a specific state ( state ex: open or closed or all report )exists.
    I have to find the time difference between the 2 states . How could I do that ?
    The first row shows null for the previous state . How could get actual previous state for the first row?
      SELECT si.station_name,
                    vppstation.avi_control_state_code.STATE_SHORT_NAME,
                    ash.state_id ,
                    lag(ash.state_id) over (order by ash.STATE_EFF_DATE desc) previous_state,
                    TO_NUMBER(TO_CHAR(ash.state_eff_date, 'SSSSS')) "periods in sec",
                    TO_CHAR(ash.state_eff_date, 'dd-mon-yyyy hh24:mi:ss am') "Date"
               from vppstation.avi_state_history ash
    left outer join vppstation.avi_control_state_code
                 on ash.state_id = vppstation.avi_control_state_code.state_id
    LEFT OUTER JOIN vpproadside.stations_installed si  
                 ON ash.station_id = si.station_id               
              where ash.state_eff_date >= to_date('28/02/2010', 'dd/mm/yyyy')
                and ash.state_eff_date <= to_date('03/03/2010', 'dd/mm/yyyy') ;
           group by si.station_name
                         ash.state_id
           order by ash.state_eff_date asc ;
    STATION_NAME                   STATE_SHORT_NAME STATE_ID               PREVIOUS_STATE         periods in sec         Date                   
    IRDNCST02                      Open             1                    NULL                  85166                  01-mar-2010 23:39:26 pm
    IRDNCST02                      All Report       3                      1                      85159                  01-mar-2010 23:39:19 pm
    IRDNCMT01                      Closed           2                      3                      81376                  01-mar-2010 22:36:16 pm
    IRDNCST02                      Open             1                      2                      78723                  01-mar-2010 21:52:03 pm
    IRDNCST02                      All Report       3                      1                      76023                  01-mar-2010 21:07:03 pm
    IRDNCMT01                      Open             1                      3                      55922                  01-mar-2010 15:32:02 pm
    IRDNCMT01                      Closed           2                      1                      54931                  01-mar-2010 15:15:31 pm
    IRDNCHA01                      Closed           2                      2                      41291                  01-mar-2010 11:28:11 am
    IRDNCAS01                      Open             1                      2                      38847                  01-mar-2010 10:47:27 am
    IRDNCAS01                      All Report       3                      1                      37947                  01-mar-2010 10:32:27 am
    IRDNCST02                      Open             1                      3                      35332                  01-mar-2010 09:48:52 am
    IRDNCST02                      All Report       3                      1                      32632                  01-mar-2010 09:03:52 am
    IRDNCST02                      Open             1                      3                      31502                  01-mar-2010 08:45:02 am
    IRDNCST02                      All Report       3                      1                      28802                  01-mar-2010 08:00:02 am
    IRDNCHI01                      Open             1                      3                      25368                  01-mar-2010 07:02:48 am
    IRDNCHI02                      Open             1                      1                      23939                  01-mar-2010 06:38:59 am
    IRDNCMT01                      Open             1                      1                      20696                  01-mar-2010 05:44:56 am
    IRDNCCH02                      Open             1                      1                      13452                  01-mar-2010 03:44:12 am
    Edited by: Indhu Ram on Mar 11, 2010 1:34 PM
    Edited by: Indhu Ram on Mar 11, 2010 2:20 PM

    If you look at the table which is output of the given query , there is column called "STATE_ID" It shows the current state ie open or closed or all report.
    The column 'PREVIOUS_STATE' shows the state before the current state. .In the table in 2nd row in previous_state column there is state_id = 1 (open)which is the state before 'all report state'

  • How to measure time difference between zero crossing of a sine wave and rise time of a pulse on a same graph?

    I have a 50Hz sine wave and a pulse signal on a same graph. The phase difference between two is between 0-90 degrees.
    Now I need to calculate the time difference between (when the sine wave crosses zero volts) and (when the pulse rises). The frequency will stay approximately same for both signals.
    The application is for a three phase generator. In simple words, when the time difference between the zero-crossing of sine wave and the pulse rises increases, that means that the load on the generator has increases.
    I am a beginner user of LabView (version 9, 2009), maybe it is a very simple problem but I've been pulling my hair out for the last few days and coudln't figure anything out. Any help would be greatly appreciated. I am using DAQ USB-6008 to measure these voltages and pulse from the generator and a sensor
    I have attached a jpg (a graph that i just made with excel to explain). The time 't' is what I am trying to measure
    Cheers
    Awais 
    Message Edited by awais.h on 03-30-2010 11:20 PM
    Message Edited by awais.h on 03-30-2010 11:21 PM
    Solved!
    Go to Solution.

    Hi
    Thanks for the code but I'm afraid it won't work. Like you said the probability of choosing a value that is on both graphs may not happen. This is something that I would like the code to do automatically.
    But I did use the previous code posted and made some modifications to it and it seems to work perfectly. Now the next thing is to be able to get just that one value that tells you the first time difference.
    Here is what I get using that code.
    As you can see from the t Values. I only need the one that is highlighted. If there is a way to filter out the rest it would be great.
    I was thinking of a while loop and as soon as the value is higher than 3E-5 it would store the number and stop the loop, but I'm not too familiar with arrays in labview.
    Here is the the code modified.
    As you can see, it wasn't that big of a modification and it still is your code.
    I will keep trying.
    Thanks for the help
    Attachments:
    FinalShockSpeed.vi ‏55 KB

  • Lost connection detection time difference

    Having a problem understanding why a broken JDBC connection is detected under Windows much quicker than it is under Linux.
    I have an process that opens a connection to MSSQL using JDBC, a Stored Procedure is then executed and the result set
    processed, this execute step is repeated every 60 seconds or so. If any exception is thrown then resources are closed, sleep
    for 60 seconds, the connection is reopened (if fails then sleeps and repeats), once reopened the process continues. There is logging throughout
    the above steps.
    On Windows Vista 64bit Sun Java platform the process runs fine, if I deliberately break the connection (stop MSSQL service), the process
    logs a problems within 60 seconds and starts handling the error, when the MSSQL comes back then within 60 seonds the connection is remade
    and the process continues as expected.
    Under Ubuntu 10 64bit both Sun and OpenJDK the process runs fine, until the connectionis broken, as it takes about 17 minutes for the exception to be thrown
    for the broken connection (stopped MSSQL) to be detected, as opposed to under Windows taking seconds. Once detected then the process works as expected, retrying
    and reconnecting as it should.
    The libs and code used are the same the only difference between the windows and linux versions are the logging path parameter, have tried with different versions of Java
    and with different MSSQL JDBC drivers.
    What could be the reason for the time difference in the lost connection detection between Windows and Linux? Any help tips would be most welcome.
    Thanks.

    The connection is only made once and used throughout, it is only closed if there is a problem. This runs absolutely fine with logging for weeks, the execute and processing take millisecondsIt is pointless to keep the connection in that situation. Create it every time.
    Doing that might even fix your problem. But regardless you should still not keep it.
    Have jujst checked the timings and if the db connection is broken the on Linux (Ubuntu) the exception generated by step 4. takes up to 15 minutes 35 seconds to move on to step 7. on Windows though it is instant, there is a log message output prior to the execute statement this outputs then the exeception logged.You have an existing connection.
    Then you attempt a request which I am guess takes 17 minutes to timeout. (That happens because you are testing by stopping the server.)
    That is the problem.
    First verify the connection url. It might have timeout values in it.
    If not then the next most likely cause is that someone changed the OS (not java) TCP timeout values. Bad idea if they did. And the only way to fix is to change them back to something reasonable. You can code around this by using two threads. One that sets a timer and the other that runs the request. If the timer fires then attempt to cancel the request (see the jdbc api.)

  • Time Out Functionality in APEX

    Currently I am working on APEX 3.1 and using OID (10.1.2) for LDAP Authentication.
    I want to implement time out functionality in my application.
    Ex: If users logs into to APEX Application and keeping the page ideal for 15 min. When user tries to access the application again. I need to redirect him to SSO page.
    Can anyone suggest me, How can I achieve this functionality.
    Thanks in advance
    Regards
    Balaji S

    Hello Balaji,
    The easiest thing would be: Upgrade to version 3.2. Then session timeout is out-of-the-box....
    Greetings,
    Roel
    http://roelhartman.blogspot.com/

Maybe you are looking for

  • Audio Stream Recorder - Error: Audio device is already being used by another prog

    I realized that Audio Stream Recorder is does not "work" through server list feature. So I am simply trying to use the manual method of adding URL's to the interface. However regardless of the type of stream, shoutcast, windows media or real audio, I

  • Streaming audio issue

    I'm trying to listen to live streaming audio from MLB.com, and it works fine... for a while. The little marker on the QT application slowly makes its way to the right side of the screen as the audio plays. Once it gets to the far right side (as if it

  • How to show all days events without scrolling?

    I use iCal as a project program, and the projects run as all day events in the top. But it seems like the new iCal (I used version 4 before) doen't show all my all day events. I can only see 5 at a time, without scrolling. In the old iCal, the size o

  • Mini crashes when another mac wants to access it

    Recently, our mini crashes every time another mac tries to access it or its attached printer. There are no other problems and if the mini is used to access the other Macs all is fine. It has worked fine for over 2 years. Anyone know what's wrong?

  • Alternative database

    Is there anyonewho can help me to install the wli on a different database then those who are certified. For instance an informix or mysql database. We already imported the schema from an oracle to an mysql. The server boots but i get an sql exception