Adding 2 Time formulas in Textboxes to get a total time

I have been trying to add 2 time calculations together to get a total time rounded to the minute, but have been unsucessful.
What I have right now in field "TimeIn1 and TimeOut1" is the calculation on click "$=Num2Time(Time())"
I am tryingto make it so that the person using the form can click in the Time In boxes and have the time automatically entered. Then I want to add 4 fields together
to get a total time spent on a project.
The 4 fields are;
TimeIn1
TimeOut1
TimeIn2
TimeOut2
Total Time
I need it to do the equasion like this;
(Timein1+(TimeOut1-TimeIn2)+TimeOut2)/60=TotalTime
Can anyone help me.Is the easiest way to run the formula as a formcalc or Is a Java Script better.
Please help this newbie.

Here is a script that will do the task in Acrobat, you will have to change the field names and formats to match your form:
// start time
// Start time field name
var cStartName = "StartTime";
// Start time format:
var cStartFormat = "HH:MM";
// end time
// end time field name
var cEndName = "EndTime";
// End time format:
var cEndFormat = "HH:MM";
// some conversion functions
// function to convert time string to minutes
function Time2Num(cTime, cFormat) {
// convert time string to minutes
// convert time string to date object
var oDate = util.scand("mm/dd/yyyy " + cFormat, "01/01/1970 " + cTime);
// convert date object to number of milliseconds
var nTime = oDate.getTime();
// convert milliseconds to minutes and return value
return Math.round(nTime / (1000 * 60));
} // end Time2Num function
function Num2Time(nMinutes) {
// convert time string to Hours and Minute
// hours in nMinues
var nHrs = Math.floor(nMinutes / 60);
// remainder minutes from hours in nMinutes
var nMins = nMinutes % 60;
// return formatted time string
return util.printf("%,101.0f" + ":" + "%,102.0f", nHrs, nMins);
} // end Num2Time
// end conversion functions
// perform the calculation using the fields:
// get the values of the fields
var cStartTime = this.getField(cStartName).value;
var cEndTime = this.getField(cEndName).value;
// clear the value
event.value = "";
// test for not null time strings
if(cStartTime != "" && cEndTime != "") {
// compute the time difference in minutes
nDiff = Time2Num(cEndTime, cEndFormat) - Time2Num(cStartTime, cStartFormat);
event.value = Num2Time(nDiff);
} //end not null values

Similar Messages

  • I keep getting my contacts added each time i sync causing me to have duplicate contacts

    Dulicate contacts. everytime i sync my Ipad and Iphone i get the same contacts added each time.
    Help

    Hi,
    You may have to disable '''Site Preferences''' in '''Tools''' ('''Alt''' + '''T''') > '''Options''' > '''Privacy''' > '''Settings'''..., if it is enabled (ticked).
    [https://support.mozilla.org/en-US/kb/Options%20window%20-%20Privacy%20panel?as=u Privacy Panel]
    https://www.mozilla.org/en-US/firefox/new/

  • Formula to get a total if I'm adding a checkbox beside each items?

    Simple question :
    I have 3 elements on 1 column : A1 = 5$ ; A2=10$ ; A3 = 15$. Each of the elements have a checkbox in the second column. What is the formula if I want to get a total ONLY if the checkbox is TRUE?
    Thanks!

    Which decimal delimiter are you using on your system ?
    If you are using the comma, you must use semi-colons in place of commas to separate the parameters.
    I must apologize for the double post but yesterdays the forum behaved wrongly here. So I clicked several times on the {Post Message) button with no visible effect. It appears that in fact the task was done with no echo on the display
    Yvan KOENIG (VALLAURIS, France) lundi 1 février 2010 11:11:15

  • How to remove the 0 that is added to the formula result

    Hi,
           I have a formula field. i placed the formula field in the group footer. zero (0) is added to the formula result. if the formula result is 8 then i am getting 0.00 and 8 as data when i select the browse field data of that field . how to remove the zero. i also used supress formula for the field. but it is not working. any idea on this regard.
    Regards,
    Shanthakumar.

    hi,
      Formula : GRP1Focus
                  if ({@Grp1BrandName}={@All Brand Names})  then {@FocusValue NBSH}. when i right click the formula field and select browse data. 0.00 and 8 are displaying.
    Suppress formula
             GRP1Focus=0
    Regards,
    Shanthakumar

  • How to get the total execution time from a tkprof file

    Hi,
    I have a tkprof file. How can I get the total execution time. Going through the file i guess the sum of "Total Waited" would give the total time in the section "Elapsed times include waiting on following events:"
    . The sample of tkprof is given below.
    SQL ID: gg52tq1ajzy7t Plan Hash: 3406052038
    SELECT POSTED_FLAG
    FROM
    AP_INVOICE_PAYMENTS WHERE CHECK_ID = :B1 UNION ALL SELECT POSTED_FLAG FROM
      AP_PAYMENT_HISTORY APH, AP_SYSTEM_PARAMETERS ASP WHERE CHECK_ID = :B1 AND
      NVL(APH.ORG_ID, -99) = NVL(ASP.ORG_ID, -99) AND
      (NVL(ASP.WHEN_TO_ACCOUNT_PMT, 'ALWAYS') = 'ALWAYS' OR
      (NVL(ASP.WHEN_TO_ACCOUNT_PMT, 'ALWAYS') = 'CLEARING ONLY' AND
      APH.TRANSACTION_TYPE IN ('PAYMENT CLEARING', 'PAYMENT UNCLEARING')))
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute    442      0.08       0.13          0          0          0           0
    Fetch      963      0.22       4.72        350      16955          0         521
    total     1406      0.31       4.85        350      16955          0         521
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 173     (recursive depth: 1)
    Number of plan statistics captured: 1
    Rows (1st) Rows (avg) Rows (max)  Row Source Operation
             1          1          1  UNION-ALL  (cr=38 pr=3 pw=0 time=139 us)
             1          1          1   TABLE ACCESS BY INDEX ROWID AP_INVOICE_PAYMENTS_ALL (cr=5 pr=0 pw=0 time=124 us cost=6 size=12 card=1)
             1          1          1    INDEX RANGE SCAN AP_INVOICE_PAYMENTS_N2 (cr=4 pr=0 pw=0 time=92 us cost=3 size=0 card=70)(object id 27741)
             0          0          0   NESTED LOOPS  (cr=33 pr=3 pw=0 time=20897 us)
             0          0          0    NESTED LOOPS  (cr=33 pr=3 pw=0 time=20891 us cost=12 size=41 card=1)
             1          1          1     TABLE ACCESS FULL AP_SYSTEM_PARAMETERS_ALL (cr=30 pr=0 pw=0 time=313 us cost=9 size=11 card=1)
             0          0          0     INDEX RANGE SCAN AP_PAYMENT_HISTORY_N1 (cr=3 pr=3 pw=0 time=20568 us cost=2 size=0 card=1)(object id 27834)
             0          0          0    TABLE ACCESS BY INDEX ROWID AP_PAYMENT_HISTORY_ALL (cr=0 pr=0 pw=0 time=0 us cost=3 size=30 card=1)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      db file sequential read                       350        0.15          4.33
      Disk file operations I/O                        3        0.00          0.00
      latch: shared pool                              1        0.17          0.17
    ********************************************************************************

    user13019948 wrote:
    Hi,
    I have a tkprof file. How can I get the total execution time.
    call count cpu elapsed disk query current rows
    total 1406 0.31 4.85 350 16955 0 521TOTAL ELAPSED TIME is 4.85 seconds from line above

  • Adding a time stamp

    How do I add a time stamp to video clips using the date and time the video was taken?

    GreenRoom
    What version of Premiere Elements are you using and on what computer operating system is it running.
    Premiere Elements (any version) does not have a built in feature for "adding a time stamp".
    What you can do is use the DVDate Plug-in for Premiere Elements for that task. Please see
    http://dvdate.ru/
    Please read details of the DVDate Plug-in in Item 0014 of my Premiere Elements 12 Daily Discovery blog post
    ATR Premiere Elements Troubleshooting: Premiere Elements 12 Daily Discoveries
    We will be looking forward to news of the outcome.
    Thank you.
    ATR

  • A simple percentage? How does one add a percentage to a number? If I have 100 and I want to add 15% and get a total, what formula would I use?

    How does one add a percentage to a number? If I have 100 and I want to add 15% and get a total, what formula would I use?

    You can do something like this:
    D2=B2*(1+C2/100)
    this means in the cell D2 type the following "=B2*(1+C2/100)"... leave out the double quotes

  • ITunes added extra time to a track

    iTunes added extra time to a track after transferring the song from my computer.  What do I do to to transfer the song correctly and remove the extra (several minutes) of dead air that iTunes added to the end of the track?

    Well....
    First of all, let me confirm exactly what you are doing.
    I notice you say iTunes is not recognising the change. So when you play the song in iTunes, it does not stop at the new time you've entered, is this correct? Or
    is it playing okay in iTunes, but not on your iPod? If this is what's happening, you have Synced your iPod after the change, haven't you? (Any changes you make in iTunes while the iPod is connected to iTunes will almost certainly not be activated on the iPod until you do another Sync.)
    (If you manually manage the music on your iPod, you will need to remove the track from the iPod and then put it back on again. Putting it back on should cause the newly revised stop time to be on your iPod.)
    So if your stop time is shown (in iTunes) as 2:52, but the track is not stopping at that time - in iTunes - then I suggest you do a repair of iTunes. To repair iTunes, download iTunes and go through the instal procedure. (Do not delete or remove the existing iTunes.) Once the instal procedure sees the existing iTunes, you should see an option to either repair or start new, choose the repair option.
    I've had to use the repair iTunes option myself, a few weeks ago, and it fixed the issue I was having. Can't remember what the issue was though!
    Finally, if the track plays okay in iTunes but not on the iPod after a new Sync, the only thing I can suggest is a Restore of your iPod. This will remove everything from the iPod and the next Sync put back what it finds in your library. If you manually manage, you will need to put everything back on yourself.

  • "Recently added" playlist has disappeared - how do I get it back?

    Recently Added playlist has disappeared - how do I get it back?

    Use the iTunes File menu > New smart playlist.  The rules shown below are the rules used in the original recently added playlist, but you may change them if you wish.

  • When adding a yahoo email account I keep getting "Server Unavailable" notification.  This started after I updated my software.  I deleted my accounts and tried to re-add them but continue to get this notification??

    When adding a yahoo email account I keep getting "Server Unavailable" notification.  This started after I updated my software.  I deleted my accounts and tried to re-add them but continue to get this notification??

    hello, this is a scam tactic that is trying to trick you into installing malware, so don't download or execute this kind of stuff! as you've rightly mentioned, you're already using the latest version of firefox installed and you can always initiate a check for ''updates in firefox > help > about firefox''.
    you might also want to run a full scan of your system with the security software already in place and different tools like the [http://www.malwarebytes.org/products/malwarebytes_free free version of malwarebytes], [http://www.bleepingcomputer.com/download/adwcleaner/ adwcleaner] & [http://www.kaspersky.com/security-scan kaspersky security scan] in order to make sure that there isn't already some sort of malware active on your system that triggers these false alerts.
    [[Troubleshoot Firefox issues caused by malware]]

  • [svn:osmf:] 13557: Fixing problem where a lingering TraitAggregationHelper causes elements to be added multiple times on ParallelDisplayObjectTrait .

    Revision: 13557
    Revision: 13557
    Author:   [email protected]
    Date:     2010-01-17 10:05:12 -0800 (Sun, 17 Jan 2010)
    Log Message:
    Fixing problem where a lingering TraitAggregationHelper causes elements to be added multiple times on ParallelDisplayObjectTrait.
    Modified Paths:
        osmf/trunk/framework/MediaFramework/org/osmf/composition/ParallelDisplayObjectTrait.as

    Revision: 13557
    Revision: 13557
    Author:   [email protected]
    Date:     2010-01-17 10:05:12 -0800 (Sun, 17 Jan 2010)
    Log Message:
    Fixing problem where a lingering TraitAggregationHelper causes elements to be added multiple times on ParallelDisplayObjectTrait.
    Modified Paths:
        osmf/trunk/framework/MediaFramework/org/osmf/composition/ParallelDisplayObjectTrait.as

  • Lost sound in some film clips when finishing project.  Using iMovie 11, after adding music to photo section, could not get sound back in 2 film clips at end of movie.  Beginning clips ok. How do I restore sound? Thx.

    Lost sound in some film clips when finishing project.  Using iMovie 11, after adding music to photo section, could not get sound back in 2 film clips at end of movie.  Beginning clips ok. How do I restore sound? Thx.

    Everything in your project will be exported when you use the share menu.
    If you want to export only half, I suggest that you
    1) Select the project in the Project Library.
    2) Click FILE/DUPLICATE PROJECT
    3) Give the duplicate a name, like Project A snippet.
    4) Open the duplicate project in the Project editor and delete the segments that you do not need.
    5) Then Share.
    You mentioned surrounding a portion of the clip you were editing in Yellow. Once you do this, you should right-click and then select either DELETE SELECTION, TRIM TO SELECTION, or one of the other options available. That is a key tool in editing.
    You mentioned MPEG Streamclip. I agree that MPEG Streamclip is a great tool.

  • Recently added     button accidently deleted How do I get this button back?

    'Recently added' button accidently deleted How do I get this button back?
    I can not find where my tracks off a cd are
    on my imac with out this button or
    icon on the left hand side of itunes.
    HELP I am technically challenged but
    relatively intelligent musician!

    catcowkitty wrote:
    'Recently added' button
    that button is actually a *smart playlist* which you can create yourself quite easily.
    in iTunes, choose +new smart playlist+ from the file menu and recreate the following rules:
    the screenshot is from my original recently added playlist.
    JGG

  • [svn] 688: asc: adding a barebones build. properties so we get line numbers on stack traces

    Revision: 688
    Author: [email protected]
    Date: 2008-02-28 14:17:43 -0800 (Thu, 28 Feb 2008)
    Log Message:
    asc: adding a barebones build.properties so we get line numbers on stack traces
    Added Paths:
    flex/sdk/trunk/modules/asc/build/java/build.properties

    Revision: 688
    Author: [email protected]
    Date: 2008-02-28 14:17:43 -0800 (Thu, 28 Feb 2008)
    Log Message:
    asc: adding a barebones build.properties so we get line numbers on stack traces
    Added Paths:
    flex/sdk/trunk/modules/asc/build/java/build.properties

  • I have just added a time machine to my iMac and it is saying it will take 11 days to do the first back up.  Any ideas?

    I have just added a time machine to my iMac and it is saying it will take 11 days to do the first back up.  Any ideas?  It is only 355GB but is being backed up  wirelessly but 11 days?
    Help.

    Hi lajetidreaming, I'm in the same boat; "See you in 8 days".
    As LaPastenague says, use an ethernetcable for the initial backup.
    And I will add; Since TimeMachine don't accept any interruptions during the initial backup, make a small backup first. That is - exclude a number of 'secundary' folders like music etc.
    When you have one backup completed, TimeMachine is much more forgiving about interrupts, rebooting your Mac and so.
    Good luck!

Maybe you are looking for

  • GIF Transparency problem

    I'm having a problem with animated GIF transparencies and photoshop. We've been having "halo" problems with some of our rendred images (transparencies) so I've been testing all of the animated GIF's in photoshop after compling them in Fireworks. The

  • Billing document without number

    Dears, we have a billing document which was created, but it does not have a number. It is related to a delivery. When we go in the document flow we can see there is an invoice, but it does not have a number and appears as blocked. We cannot display t

  • "The connection was reset" only in Firefox - why?

    I have a site that consistently gives "The connection was reset" every three or four clicks. Refreshing brings the page up fine. Server logs show no errors whatsoever, the hits all show 200 responses with no errors logged by back-end code. This only

  • Downloading software application

     how can i get whether IMesh or MIMI or even skype software to download to my hp webos I am a law student and at times these applications are necessary. I saw the eread black law dictionary but got error message something about Ilivid.. Post relates

  • Can't get in to make easy e-mail addy for new printer

    HP won't take any of my  addresses or passwords to get in to change address of printer to one that i can remember