calculation of duration between two events

Hello guys

I found a lot of information here how to calculate the difference in time between two events. The application I'm working with has a strange time resembling the export:

The date looks like jj-mm-aa which I want to turn the date in dd-mm-yy format for easy sorting and I want to have the time difference in hours and minutes between two events. I thought the first thing to do is to extract the time information, then transform the date into the aa-mm-jj and calculate the time difference from these two. Can someone help me with this?

Thank you very much

Hans

Hello

You can try something like that.

Table 1

A1  date time string
A2  20-03-16 00:52:22
A3  19-03-16 01:26:17
A4  18-03-16 01:41:30
A5  16-03-16 00:01:08
A6  11-03-16 23:40:42
   
B1  date time
B2  =DATE("20"&MID(A2,7,2),MID(A2,4,2),MID(A2,1,2))+TIMEVALUE(TIME(MID(A2,10,2),MID(A2,13,2),MID(A2,16,2)))
B3  =DATE("20"&MID(A3,7,2),MID(A3,4,2),MID(A3,1,2))+TIMEVALUE(TIME(MID(A3,10,2),MID(A3,13,2),MID(A3,16,2)))
B4  =DATE("20"&MID(A4,7,2),MID(A4,4,2),MID(A4,1,2))+TIMEVALUE(TIME(MID(A4,10,2),MID(A4,13,2),MID(A4,16,2)))
B5  =DATE("20"&MID(A5,7,2),MID(A5,4,2),MID(A5,1,2))+TIMEVALUE(TIME(MID(A5,10,2),MID(A5,13,2),MID(A5,16,2)))
B6  =DATE("20"&MID(A6,7,2),MID(A6,4,2),MID(A6,1,2))+TIMEVALUE(TIME(MID(A6,10,2),MID(A6,13,2),MID(A6,16,2)))
   
C1  duration
C2  =B2-B3
C3  =B3-B4
C4  =B4-B5
C5  =B5-B6
C6  =B6-B7

Notes.

Formula in B2 and C2 can be filled down.

Table is designed with numbers v2.

Kind regards

H

Tags: iWork

Similar Questions

  • calculation of time between two time as timestamp

    How can calculate two hour, START as the timestamp TIME in the data type, END TIME as of time also.

    select END_TIME-START_TIME from PROG_DLY_WORK
    

    Result

    + 01:50:00.000000 000000000

    How can get exactly the time spent as 01:50 ? and these calculated time must sum (elapsed_time) in another column.

    oracle as PaaS cloud environment

    Product VERSION STATUS
    NLSRTL11.2.0.3.0Production
    Oracle Database 11g Enterprise Edition11.2.0.3.064 bit Production
    PL/SQL11.2.0.3.0Production
    AMT for Linux:11.2.0.3.0Production

    Time difference between two columns in hours

    Start

    FOR REC IN (SELECT START_TIME, END_TIME, CALC_TIME CAL_ID)

    LOOP

    UPDATE CALc_TIME

    SET ELAPSED_TIME = round (())

    TO_DATE (to_char (REC. End_time, 'ddmmyyyyhh24miss'),

    "ddmmyyyyhh24miss")-

    TO_DATE (to_char (REC. Start_time, 'ddmmyyyyhh24miss'),

    "ddmmyyyyhh24miss")

    () * 24).

    WHERE CAL_ID = REC. CAL_ID;

    END LOOP;

    end;

    Lag in minutes

    Start

    FOR REC IN (SELECT START_TIME, END_TIME, CALC_TIME CAL_ID)

    LOOP

    UPDATE CALc_TIME

    SET ELAPSED_TIME = round (())

    TO_DATE (to_char (REC. End_time, 'ddmmyyyyhh24miss'),

    "ddmmyyyyhh24miss")-

    TO_DATE (to_char (REC. Start_time, 'ddmmyyyyhh24miss'),

    "ddmmyyyyhh24miss")

    () * 24 * 60)

    WHERE CAL_ID = REC. CAL_ID;

    END LOOP;

    end;

  • Calculating the distance between two images... ?

    Hello

    I'm trying to calculate the distance between two images (A and F - there are other images between A and F), but I can't seem to understand how to make good sense.

    Image A.x is "(stage/2)-(A.width/2)" and the image of F.x is "provable - imgSpace" which is a negative value (all images x is a negative value for image A.x). "

    In my view, the calculation is F.x - A.x, and although it could be good I still ned the value to be non-negative.

    Does anyone know how to do this?

    Thanks in advanse...

    I think you can find out the distance with this equation,

    var len:Numer = Math.abs (A.x - F.x);

  • Calculation of connection between two fields

    In my PDF, I have two fields - allows you to call the A and B.

    When you enter the number 26 in the to field, B field should automatically generate the value 14 (less than the value in A 12). I managed to get this working.

    However, I wish this works in reverse, so that if you field a number (for example, 3) in the B field, will automatically generate the number 15 (greater than the value of B 12).

    Unfortunately, I can't get either to work, but not both. If I set the to field with the formula, all what I enter in the B field cannot substitute the calculation generated from the value defined in A.

    Any ideas on how I can get this working? Thank you.

    You can use JavaScript in the Calculate of the two fields event.

    For example, in the first field, do something like:

    (function () {
    
        if (event.source && event.source !== event.target) {
            event.value = +getField("text2").value + 12;
        }
    
    })();
    

    and in the other field, use:

    (function () {
    
        if (event.source && event.source !== event.target) {
            event.value = +getField("text1").value - 12;
        }
    
    })();
    

    Change "text2" and "text1" to match the domain names that you use.

  • Dynamic calculation of the number of days between two dates in a table

    Hello

    I'm working on request where I dynamically calculate the number of days between two dates in a table.

    The calculation must be dynamic, i.e., when I recover the Start_date and End_date and move to the field following (call_duration) in the same row, the difference must be calculated dynamically in this area and make sure the field read-only.

    APEX version: 5.0

    Hi BO123,

    BO123 wrote:

    Hello

    I'm working on request where I dynamically calculate the number of days between two dates in a table.

    The calculation must be dynamic, i.e., when I recover the Start_date and End_date and move to the field following (call_duration) in the same row, the difference must be calculated dynamically in this area and make sure the field read-only.

    APEX version: 5.0

    one of the way to do this by calling ajax on change of end_date.

    See the sample code given below to fetch the resulting duration and making the field read only after calculation

    Step 1: Change your page

    under CSS-> Inline, put the code below

    .row_item_disabled {
      cursor: default;
      opacity: 0.5;
      filter: alpha(opacity=50);
      pointer-events: none;
    }
    

    Step 2: Create on demand Ajax process I say CALC_DURATION

    Please check Procces Ajax, see line 6.7 How to assign a value to the variable sent by ajax call

    Declare
      p_start_date  date;
      p_end_date    date;
      p_duration number;
    Begin
      p_start_date  := to_date(apex_application.g_x01);
      p_end_date    := to_date(apex_application.g_x02);
    
       --do your calculation and assign the output to the variable p_duration
      select p_end_date - p_start_date into p_duration
        from dual;
    
      -- return calculated duration
      sys.htp.p(p_duration);
    End;
    

    Step 3: Create the javascript function

    Change your page-> the function and the declaration of the Global Variable-> put the javascript function

    You must extract the rowid in the first place, for which you want to set the time, see line 2

    assuming f06, f07 and f08 is the id of the start date, and end date columns respectively, and duration

    See no line no 8 how set the value returned by the process of ajax at the duration column

    Replace your column to the respective column identifiers in the code below

    function f_calulate_duration(pThis) {
      var row_id  = pThis.id.substr(4);
      var start_date = $('#f06_'+row_id).val();
      apex.server.process ( "CALC_DURATION", {
      x01: start_date,x02: $(pThis).val()
    }, { success: function( pData ) {
    // set duration to duration column
    $('#f08_'+row_id).val(pData);
    // disable duration column
    $("#f08_" + row_id).attr("readonly", true).addClass('row_item_disabled'); }
    });
    }
    

    Step 4: choose the end date call the javascript function

    Go to report attributes-> edit your Date column end-> column-> Attrbiutes element attributes-> put the code below

    onchange="javascript:f_calulate_duration(this);"
    


    hope this helps you,

    Kind regards

    Jitendra

  • Week, month, quarter and year calculation between two days with a quantity?

    I have a problem that I can't solve.

    Users enter a forecast (quantity) and a validity period between two dates.
    Expected quantity is always a monthly forecast.

    The problem is that the user wants to see the forecast by week, month, quarter and year.


    Material |     Quantity |     Date_from | Date_to
    Label45 |     1500 |     2009-09-01 | 2009-12-31


    How can I easily calculate the amount so that the user can enter e.g. week 2009.41 and see the forecast this week?

    You should test for your specific environment, but I would be very surprised if a function has surpassed SQL directly.

  • Calculate the (age) years between two dates

    Nice day!

    I have not been able to find an answer, that I was able to use in the archives or online and would be very grateful for the help.  I'm working with Adobe Acrobat Pro XI (not LiveCycle) and I have very little experience with programming (for the most part, copy / paste).

    I need to create a text box that calculates the number of years between two dates entered, i.e. the age when the date of birth and death are given.  Also, would be nice if she was a Virgin until the two were provided.  Anyone would be able to give me the code I need to put in the custom calculation script?

    Once again, any help would be much appreciated!  Thank you and have a wonderful day!

    For the fields for Date of birth DOB and DOD for the Date of death and age in complete years both by using a'd-mmm-yyyy' date format you can use a custom calculation to the JavaScript for the field of age as:

    function GetField (cName) {}
    get the field with error trapping object;
    oField var = this.getField (cName);
    test error;
    if(oField == null) app.alert ("error during the" + cName, 1, 0);
    Returns the field object;
    return oField;
    } / / end GetField function;

    function {Scand (cFormat, cString)
    using date string format convert object date;
    convert string to date using format;
    Kai var = util.scand (cFormat, cString);
    the value null is an error of conversion;
    if(oDate == null) app.alert ("Conversion error" cString "by using the format" + cFormat, 1, 0);
    date of return;
    Return to oDate;
    } / / end Scand function;

    clear the value of the field;

    Event.Value ="";
    get data dob and dod;
    var oDOB = GetField ("DOB");
    Var o = GetField ("DOD");

    treat only if DOB and DOD have value and are not null;
    If (oDOB! = null & o! = null & oDOB.value! = "" & oDOD.value!) = "") {}

    convert the DOB and DOD to date objects.
    oDOB var = util.scand ("d-mmm-yyyy", oDOB.value);
    O var = util.scand ("d-mmm-yyyy", oDOD.value);

    get the difference over the years;
    var Age = oDOD.getFullYear () - oDOB.getFullYear ();

    adjust for month of previous DOD DOB;
    If (oDOD.GetMonth)< odob.getmonth())="">

    adjust the DOD before DOB date in the month of birth;

    If (oDOD.GetMonth () == oDOB.getMonth () & oDOD.getDate ())< odob.getdate())="">
    Set the value of the field;

    Event.Value = Age;
    }

  • Calculate the difference in days between two Dates

    Hello

    I'm trying to understand how to calculate the difference in days between two dates using JavaScript in LiveCycle. (Minimum = JavaScript knowledge)

    Where 'Start_Date' and 'Current_Date' are the names of the two dates in the palette of the hierarchy. (the two Date/time field)

    * Current date is using the object > value > execution property > current Date/time

    I need a text or number field showing the difference in days. (Difference_in_Days)

    I noticed the following code is pretty standard among other responses:

    var

    Start_date = new Date (Start_Date);

    var

    Current_Date = new Date (Current_Date);

    var

    nAgeMilliseconds = Current_Date.getTime) - Start_date.getTime ();

    var

    nMilliSecondsPerYear = 365 * 24 * 60 * 60 * 1000 ;

    I know there is lack of code and code above are may not be not correct.

    Please notify.

    OK, that's because of the way that javascript and works of the calculate event.  The field will be filled with whatever the script resolves at the end of execution. Technically, your script does not have a value because the last thing you do is an assignment to a variable.  Change the last line as follows:

    Math.ABS ((firstDate.getTime)

    ((- secondDate.getTime (()) / (oneDay));

    (eliminate the variable assignment) and get rid of the app.alert.  Your script will "return" (have) regardless of the value of calculation from the East and which will be stored in the field.

  • Calculate the number of days between two dates

    Hello

    Can someone help please change my formcalc script to calculate the number of working days between two date fields.  My script currently calculates the total number of days between two dates, including the weekends which must be excluded from the total.

    If

    (HasValue (Start_Date1) & HasValue (End_Date1)) then

    $

    = Date2Num (End_Date1, "YYYY-MM-DD" "en_IE") - Date2Num (Start_Date1, "YYYY-MM-DD" "en_IE") + 1

    on the other

    ""

    endif

    Any help will be most appreciated.

    Thank you.

    Check...

    (1) you said that you put the script on the event «days1» calculate My sample imitates the variable names used in the original message, "Start_Date1" and "End_Date1". If the names of variables for the start and end dates are different, you will need to modify the script to account for these names.

    (2) the Date2Num functions in the calculation of the "totalDays" use the date format "YYYY-MM-DD". If your date habits differ from "YYYY-MM-DD" FormCalc will complain.

    Steve

  • Data connection between two applications

    Hello world

    Is there a way to open a connection of type 'stream' between two applications without using the file system?  Writing on file seems too gross.  Surely someone does this!

    What I found so far:

    Object 'Event' does not seem to do... DOM seems to be communication within an application or suite.

    "Socket" seems to be ruled out by security, but no official word on this issue...

    "Then" explicitly says that only one application can access a serial port at any time...

    Class interface 'Connection' seems to have many children (taking one) but all seem to be dead ends.

    Anyone?

    Thank you

    DD

    I suggest using a global event. You can attach an object to the event and look to the other application.

    See the documentation for the API of ApplicationManager.postGlobalEvent () and the GlobalEventListener interface.

  • Switch between two intelligent forms with a single button?

    Hello!  I work at 8 Captivate and try to use a single button to switch between two smartshapes.  I can't for the life of me figure out how to do it.  I know its possible to make it 'show' and 'hide', but is it possible to simply create a user click on a button and whenever we click on it, it comes and goes between two different smartshapes?

    Im trying to show the user the functionality on a piece of equipment when they press a button.  When they push the button, it comes and goes between two different read out on the screen.

    Thanks in advance!

    Have you looked at the blog post that I posted a link: I offer 4 scenarios.

    It can also easily be done, if you have a separate (shape) button to switch between two different objects:

    1. Create a user with a default value of 0 v_visib variable
    2. Create two objects and one of them is visible, the other invisible output ("eye" in the Properties Panel icon); I've tagged the ShapeOne and ShapeTwo, where ShapeOne is visible at the beginning
    3. Create this advanced conditional action (you can also turn it into a shared action):

    IF v_visib equals 0
    Hide ShapeOne
    See the ShapeTwo
    Toggle v_visib
    ON THE OTHER

    Hide ShapeTwo

    See the ShapeOne

    Toggle v_visib

    4 assign this action to the success of the button event

  • How to stop a freeze on transition framing between two video clips?

    Hi all

    Newbiee here

    How to stop a freeze on transition framing between two video clips?

    Cheers for your help in advance.

    Make sure that your clips have long enough 'handles', extra material before and after the change, the less both the duration of the transition.

  • How the control number of the minorticks between two tick marks of the axis?

    Hi guys,.

    I want to draw a number of minor ticks between two graduations of the vertical axis of the column chart based on user input.

    ex: If user provides 2 there are two minor ticks between two tick marks on the axis.

    Thanks in advance.

    From what I can tell with sleeping with her, minorInterval value divides the vertical County to get the appropriate number of ticks between each interval.

    
    
    

    In the example above, I have the interval to 10 and when I put the minorInterval at 2, then I get 5 ticks.  The first tick is the interval and then followed by 4 more ticks.

    In your example, in order for me to see 2 ticks between intervals, then, I must assign the minorInterval 3.5 .

    10 / 3.5 = 3 (2 ticks)

    The forumla should be something like:

    ViewableTicks = interval / (selected ticks + 1);

    So, if I created a drop down list with 1-9 ticks (because 0 does not work if you are showing minor ticks), then when the option is changed, I calculate the value for minor ticks and set the component LinearAxis (countAxis) this new value.

    protected function tickViewList_changeHandler(event:IndexChangeEvent):void
    {
     var tickCount:int = tickViewList.selectedItem;
     var tickView:Number = countAxis.interval / (tickCount + 1);
     countAxis.minorInterval = tickView;
    }
    

    I created a blog post showing my example.

    Post edited by: DeanLoganBH - add link post blog with photos of example

  • List of years between two dates

    Hello

    I am new to Livecycle Designer and learning I will.

    I have a few questions related to the same question.

    1. is it possible to create a list of years between two dates, especially the exercises? (I'm in Australia so it's July 1 to June 30).

    for example

    User between two dates in date fields:

    (Start Date of the project field) July 1, 2012 and (end Date of the project field) 30 June 2015

    Have an auto list to fill out as below:

    (List)

    2013

    2014

    2015

    or ideally

    (List)

    2012/13

    2013/14

    2014/15

    linking this (if possible).

    2. is it possible to have to repeat the lines created automatically in a table for each of the fiscal years indicated in the list above?

    If either / both of them are possible help that someone could provide would be very appreciated.

    Thank you

    Ivan

    Hello

    Please find an example that shows what I think you would do here - https://workspaces.acrobat.com/?d=F9t-rLq3bapw2d-XY0dRuQ

    I ran a few test cases and did not include the error handling to keep the code as easy to read as possible.

    If you open the form and look at the code in the click event of the update button, then that's where all the magic happens.

    Hope this helps

    Malcolm

  • ___How calculate the scale between two objects (without ArtDirector Toolkit)?

    Normally, I'd use ArtDirector Toolkit, but I can not install it or software at the present time (too long to explain why) remove.

    In any case, I have several items on the scale, and I'll try to find a formula/calculation to determine the scale.

    Example - 1 item is 3,7486 "and I want that it 5,3231" - how to calculate the percentage of the scale to expand it?

    I know you smart popular forum can help!

    Thank you!

    142.00234754308275%

    Hugh Betcha wrote: normally I'd use ArtDirector Toolkit, but I can not install it or software at the present time (too long to explain why) remove.

    Alternatively, you can Google "scale percentage between two numbers" - gives a lot of info free/calculators

Maybe you are looking for

  • Call a landline in Saudi Arabia

    I try to call a landline in Saudi Arabia with my monthly subscription but can't. Please give advice on why not. Thank you

  • Qosmio G10: Monitor completely blackened

    Hello! I have a problem with my Qosmio G10, I turn on the laptop, the fan made a noise, and finally he logs in Windows. Meanwhile, I can't see what is happening, because the screen is blacked out. I hear just to log on Windows. I tried to connect a n

  • HP 3500 PRO: software problems

    Hello, I had recently a new motherboard installed along withanother 4 G ram, bringing the total to 8 G and new 1 T hard drive seagate. I did the factory original recovery discs but I am unable to use these 4 disks to reinstall windows. After the load

  • E1200 - DHCP IPv6

    Hi all I have a connection internet pppoe dhcpv6 and my pc is two addressess, 1 ipv6 address ipv6 is the assignment of my ISP, but it is not my ISP. and it's very weird. LANandLAN Ethernet card: The connection-specific DNS suffix. :IPv6 address: 2001

  • X 51 R2 - Maximum power 220w VS 330w card

    Hi all If I try to install a GTX960 (or a 370 R7) in my X 51 R2, do you think it will work? The usual answer is "Get a 330W adapter", but as the two card requires only 1 connector 6-pin PCIe, I guess that the adapter 240W can support. R2 of Dell spec