FormCalc - how to calculate the difference between the two fields datetime in hh: mm?

Hello!

I am building a form of time sheet in which I need to calculate the difference between the start and end times and present the result.

I'm trying to do with FormCalc but if it is easier with JS is ok too.

So that's what I did on the total field, by using the calculate on a NUMERIC field called decimalValue event:

elapsed = Time2Num (endTime.formattedValue, "HH: mm")-Time2Num (startTime.formattedValue, "HH: mm")

And then I tried to convert a time field:

Total = decimalValue.rawValue;

$.formattedValue = Num2Time (total, "HH: mm")

Well, it doesn't work, it gives me crazy results in the datetime (total) field. If I type 09:00 and 09:30, the final result is... 22:30. Huh?

Please, could someone help me understand how this thing works?

Thanks a lot for the tips!

Marcos

Hi Marcos,

Here are some examples:

https://Acrobat.com/#d=kCPIgVkd09qrx6h-WRXxbQ

https://Acrobat.com/#d=EsWqBMBt3sgEXnMSsK5pRA

Hope that helps,

Niall

Tags: Adobe LiveCycle

Similar Questions

  • How to calculate the date fields while excluding Saturday and Sunday

    Hi, I use Jdeveloper 11.1.3.4

    I have an Oracle database and creates a table called holiday with 3 attributes:


    user (VARCHAR)

    (early)

    end (date)


    The idea is that you subtract the finish from the beginning and get a number of vacation days used. The thing is that the sum should exclude Saturday and Sunday.

    Any way to do it?
    /* Formatted on 6/1/2011 7:57:32 AM (QP5 v5.149.1003.31008) */
    WITH t AS (  SELECT id,
                        MAX (strt) strt,
                        MAX (finish) finish,
                        SUM (dys) days_off
                   FROM (SELECT id,
                                strt,
                                finish,
                                CASE
                                   WHEN TO_CHAR (dy, 'day') LIKE 'saturday%' THEN 0
                                   WHEN TO_CHAR (dy, 'day') LIKE 'sunday%' THEN 0
                                   ELSE 1
                                END
                                   dys
                           FROM vacations
                         MODEL
                            PARTITION BY (ID id)
                            DIMENSION BY (0 d)
                            MEASURES (POCETAK strt, KRAJ finish, POCETAK dy)
                            RULES
                               (dy [FOR d FROM 1 TO finish[0] - strt[0] INCREMENT 1] =
                                     (NVL (dy[CV () - 1], dy[CV ()]) + 1)))
               GROUP BY id
               ORDER BY id)
    SELECT t.id,
           t.strt,
           t.finish,
           t.days_off,
           vacations.korisnik,
           SUM (
              CASE
                 WHEN finish < TO_DATE ('01/07/2011', 'dd/mm/yyyy') THEN days_off
                 ELSE 0
              END)
           OVER (PARTITION BY vacations.korisnik ORDER BY t.id)
              this_years_running_total,
           SUM (
              CASE
                 WHEN finish < TO_DATE ('01/07/2011', 'dd/mm/yyyy') THEN days_off
                 ELSE 0
              END)
           OVER (PARTITION BY vacations.korisnik)
              this_years_grand_total,
           SUM (
              CASE
                 WHEN finish >= TO_DATE ('01/07/2011', 'dd/mm/yyyy')
                 THEN
                    days_off
                 ELSE
                    0
              END)
           OVER (PARTITION BY vacations.korisnik ORDER BY t.id)
              next_years_running_total,
           SUM (
              CASE
                 WHEN finish >= TO_DATE ('01/07/2011', 'dd/mm/yyyy')
                 THEN
                    days_off
                 ELSE
                    0
              END)
           OVER (PARTITION BY vacations.korisnik)
              next_years_grand_total
      FROM t, vacations
     WHERE t.id = vacations.id
    
    id                    strt               finish        daysoff          korisnik    thisyrruntot  thisyrtot   netyrruntot    nextyrtotal
    1     5/25/2011     5/31/2011     5     Kantardzic     5     22     0     26
    2     6/6/2011     6/13/2011     6     Kantardzic     11     22     0     26
    5     6/1/2011     7/6/2011     26     Kantardzic     11     22     26     26
    6     6/16/2011     6/30/2011     11     Kantardzic     22     22     26     26
    
  • How to calculate the number of days/weeks/months between 2 dates?

    Hello

    I would like to know how to calculate the number of days/weeks/months between 2 dates in OBIEE 11 g, for example, I have 26/05/2013 and 19/05/2013, then I want to get 7 days.

    Thank you!
    Jamie

    Hi Jamie,

    Through this links...

    http://www.bravesoft.com/blog/?p=682
    http://twobiee.blogspot.in/2012/01/working-with-date-differences.html

    Mark as correct it allows u...
    Thank you...

  • To build the waveform.vi function how to calculate the value of dt

    Dear all

    Please guide me How to calculate the value of dt according to waveform.vi of construction

    My sampling rate is 25000 and I take 200000 samples.

    Kind regards

    Muhammad Irfan

    It's all simple arithmetic. The inverse of the sampling frequency power of samples is then the dt or the time between samples the number of samples is not relevant.

  • How to calculate the execution time of a SCTL in FPGA VI?

    Hello

    Can someone guide me that how to calculate the execution time of a SCTL for an iteration in the FPGA VI?

    Thank you and best regards,

    Rashid

    Hello r,.

    A SCTL will always run in a beat the clock it has been linked to.  So, if you use a 40 MHz clock, this loop will run in 25 ns.  If the code cannot complete in that, or if it requires two graduations of the watch to do the calculation, your code does not compile, then you have the guarantee that this will always be how long it takes this piece of code to run.

  • How to calculate the execution time of a loop?

    Hello

    Can someone guide me that how to calculate the execution time of a loop to iterate?

    Thank you and best regards,

    Rashid

    I hope I have your question! See attached screenshot

  • How to calculate the polynomial graphic adjustment of waveform

    Hi all

    I am new to lab - view so would need a little assistance in one of the problem I have right now.

    My problem is: how to calculate the polynomial graph of waveform data adjustment? I need to convert the waveform to XY graph data, and then use the polynomial vi made integrated to calculate the fitting?

    Detail: My problem is that I have waveform graph, I calculate the vertices and the Valley, but because of the noise, my peaks and Valley detection is sometimes not exact, so to smooth the chart that I must apply the polynomial fit.

    If anyone can help me in this, I'll be very grateful.

    Thanks in advance

    Hi Omar,.

    have you seen the suggestion of Lynn above?

    You already have the values of Y (your table). Now, you need build the table of X as indicated, only to replace the value of dt with your spacing from point to point. Somewhere in your code, you know that the value that you have an x-axis indicated in milliseconds...

  • How to calculate the CPU Ready on Cluster DRS via Powercli?

    Hi all!

    I have a DRS Vsphere cluster. I want to know what is the value of the loan of CPU I have in my group.

    For example, I get 20% of powercli value, it is normal for the cluster, but if I have 100% or more, I have a problem.

    How to achieve via Powercli? And how to calculate the percentage values correctly?

    I know, I can get all values of CPU Ready of VMs cluster, but IT is not the same thing, I need overall value of CPU Ready.

    Thanks in advance!

    As far as I know you can get the cpu.ready.summation for ESXi nodes or VMs.

    For a cluster, you will need to get the value of each node in the cluster ESXi and then take the average.

    The metric cpu.radey.summation is expressed in milliseconds.

    To get a percentage, you need to calculate the percentage of loan period during the interval during which it was measured.

    Something like this (this will give the loan current %)

    $clusterName = "mycluster.

    $stat = "cpu.ready.summation".

    $esx = get-Cluster-name $clusterName | Get-VMHost

    $stats = get-Stat-entity $esx - Stat $stat - Realtime - MaxSamples 1 - forum «»

    $readyAvg = $stats | Measure-object-property - average value. Select - ExpandProperty average

    $readyPerc = $readyAvg / ($stats [0].) IntervalSecs * 1000)

    Write-Output "Cluster $($clusterName) - CPU % loan $(' {0:p}'-f $readyPerc).

  • How to calculate the cpu in the resource pool

    How to calculate the cpu in the resource pool

    and don't forget that shares in pools of resources are not inherited by the virtual machines in the pools. the action is related to the pool itself.

  • What is the difference between these two series: ONE VIDEO and a VIDEO SN184?

    Hello

    Is anyone know the difference between these two serial numbers: A VIDEO and a VIDEO SN184?

    Hi Lennart,

    This might be useful: ONE VIDEO AND ONE NON-VIDEO

    Kind regards

    Sheena

  • How to calculate the sum of two digital form fields based on the selection of the checkbox.

    I have a form in Acrobat Pro who needs a custom calculation. How to calculate the sum of two digital form fields based on a selection of the checkbox. I have three number fields. Field-A and B are simple one or two digits. Field-C is the sum, or the total field. I want to field-C have a control box which, when turned on and off, just gives a. gives the sum of A + B

    _ Field - 2

    _ Field - A 4

    [check] _ _ field - 6 C

    [disabled] _ _ field - 2 C

    Thank you

    The custom field C calculation script could be:

    (function () {
    
        // Get the values of the text fields, as numbers
        var v1 = +getField("A").value;
        var v2 = +getField("B").value;
    
        // Set this field's value based on the state of the check box named "CB"
        if (getField("CB").value !== "Off") {
            event.value = v1 + v2;
        } else {
            event.value = v1;
        }
    
    })();
    

    Replace 'A', 'B', and 'CB' with the real names of the fields.

  • How Illustrator calculates the height of box Em?

    I am trying to determine how Illustrator calculates the basic position of the top of the a Point text object bounding box.  She seems to be the same distance as an object of text box with the game setting of first base to box Em height line.  I just do not know what assets within the scope of the police which matches.  Help of the Illustrator defines it as:

    "The top of the box em in Asian fonts touches the top of the type object. This option is available regardless of the preference show Asian Options. »

    For some fonts, this distance seems to be near the pole of the police, but this is not true for each font.  The clues how Illustrator calculates it?

    metric-example.png

    Here you go

    var idoc = app.activeDocument;
    var itext = idoc.selection[0];
    
    var top = itext.position[1];
    var base = itext.anchor[1];
    
    alert('Em? size: ' + (top-base));
    
  • How to calculate the size of a VMFS volume?

    Creating a new partitiontable after ESXi 4 wiped empty was pretty easy with fdisk.
    These days with partedUtil and ESXi 5 is not so trivial.

    Consider that we have a disk/Lun, which looks like this

    ~ # partedUtil get /vmfs/devices/disks/mpx.vmhba1:C0:T4:L0
    93990 255 63 1509949440

    and suggests that the original - now messed the Volume was created with ESXi 5.
    How to calculate the value of the end in the sector so that I can recreate the VMFS partition like this:

    partedUtil setptbl ' / vmfs/devices/disks/mpx.vmhba1:C0:T4:L0 ' TPG '1-2048 ? '. AA31E02A400F11DB9590000C2911D1B8 0 "


    In this case, the correct value is 1509949349, but how do I calculate if I don't know the correct value?

    Hello

    the output of the command "partedUtil get /vmfs/devices/disks/mpx.vmhba1:C0:T4:L0" will be useful in your case, it's "93990 255 63 1509949440".

    gives us the values for C/H/S (cylinder/head/sector).

    A VMFS volume partition must end on the limit of a cylinder, so selecting the last sector of the partition table should be done using the formula endSector = (C * H * S - 1).

    who is '1509949440-1' = 1509949349.

    Concerning

    (Ref: http://www.virtuallyghetto.com/2011/07/how-to-format-and-create-vmfs-volume.html)

  • How to calculate the size of HFM Cube in SQL Server 2005

    Hello

    How to calculate the size of the HFM Cube in SQL Server2005

    Under application used to Oracle. So what's application to SQL Server?

    ***********************************************************************************************************
    SQL > select sum(bytes/1024/1024) from dba_segments where nom_segment like 'FINANCIAL_ %' and owner = 'HFM;
    SUM(BYTES/1024/1024)

    SQL > select sum(bytes/1024/1024) from dba_segments where nom_segment like FINANCIAL% HSV' and owner = 'HFM;

    SUM(BYTES/1024/1024)
    **********************************************************************************************************

    Concerning
    Smilee

    What is your goal? The subcube in HFM is a concept that applies to application layer - not so much to the database layer. The size of the subcube is the unique number of sheets (data values for January - December inclusive, for example) for the given entity, a triplet of currency or node Parent.Child. Should be considered for accounts of parent and customs that do not exist in the database, but are calculated in the RAM of the application layer.

    So if your goal is to find the largest subcubes, you could do this by querying the database and by counting the number of records per entity value (tables DCE) or combination of entity parent.child (tables of the DCN). I am not versed in SQL, but I think the script below you would just the size of the pattern and not the sizes of subcube.

    See Accelatis.com for a third party software product that can do it for you. The function is called the subcube Analyzer and was written by the same team that wrote HFM, then they should know how :-)

    -chris

  • How to calculate the total memory used by oracle under Linux?

    Hi all

    In one of my server have 148 GB of total physical memory and 12 databases are running. For capacity planning, I need to know how the Oracle server use.

    How to calculate the use oracle database? I was perplexed because Yop out his show off 148 gb 128 GB are used.

    Below for your reference:
    ++++++++++++++++++++
    == > back to top
    top - 09:52:32 up to 151 days, 15:20, 3 users, load average: 6.11, 6.00 6.05
    Tasks: 7 running, 1314, 1321 total sleep, stopped 0, 0 zombie
    CPU: 37.8%us, 1.4%sy, 0.0%ni, 55.0%id, 5.6%wa, 0.1%hi, 0.2%si, 0.0%st
    MEM: 148290444 k total, 129368792 k used, 18921652 k free, 1450292 k buffers
    Swap: 50331632 k total, 1296188 k used, 49035444 k free, 114733336 k cached


    The memory allocated to each instance is: sga total == > 34 pga = > 48 GB gb
    +++++++++++++++++++++++++++++

    SGA PGA
    4 GB 4 gb
    4 GB 4 gb
    2 GB, 4 GB
    2 GB, 4 GB
    2 GB, 4 GB
    2 GB, 4 GB
    2 GB, 4 GB
    3 gb 4 gb
    3 gb 4 gb
    4 GB 4 gb
    3 gb 4 gb
    3 gb 4 gb

    Thank you

    Try this - http://www.pythian.com/news/29703/oracle-instance-memory-usage/ for each of your instances.

    As far as I know, different instances may share only the binary code oracle and using libraries, so you should be able to easily understand the amount of memory of all instances of 12.

    Lordane Iotzov
    http://iiotzov.WordPress.com/

Maybe you are looking for

  • Sort of printing black and white only when magenta cartridge is empty?

    We have a HP Office Jet Pro 8500 a. computer running Windows Vista. The Magenta cartridge is currently empty, and we need to print an urgent document before we will be able to get a new cartridge. While trying to print a black and white document only

  • Portege R500: What DVI port duplicator would be compatible

    Hello Does anyone know what DVI port duplicator supports the portege R500 laptop.When I look at the product and its accessories none of the replicators of ports lists the portege R500 as a notebook taken in charge. Maybe there isn't one right now?

  • boot from recovery partition

    I did a clean install of windows 7 ultimate on my (touchsmart 600-1220) I got to the recovery partition, what I want is to restore my pc to its factory condition, I searched prior to this announcement, and the only solution was (in addition to order

  • random auto focus problem Canon EF-S 18-55

    Hello I have worked with Canon EF-S 18-55 IS NO Lenes and have found a problem that I just can't seen to solve. The problem is I get autofocus, but at times it will not focus. I changed the card with a known good, engine Assembly, contacts with good

  • no support for dv6768se

    No update for the dv6000 BIOS Careful, HP has turned to deception. I bought thousands of dollars worth of HP products. I recommend the purchase of HP in my official duties as a Director of engineering. However, I was disappointed by the performance a