Help creating time worked field on time sheet.

I am new to acrobat. I am creating a time sheet submittable form. I have start time fields and end time fields and now i need a field that  calculates total time worked in hours. I could do this using military time except that in the calculations tab in field properties there is no subtraction calculaton option, just addition. Is there anyway to acomplish this by writing a script? I know nothing abiut writing scripts, PLEASE HELP.

You need to use JavaScript to write the custom JavaScript Code. You can convert the time string to a JS data object and do the math at milliseconds.
You can split the time string into hours and minutes, convert the hours to minutes and add to the minutes, do the math in minutes and finally convert the minutes back into hours and minutes.
Since you will be repeating the math for each day, I would look at creating a function to convert the time string cell to minutes for the computation.
There can be problems with leading zeros and no separator symbols since the Number format strips the leading zeros from number character strings.
function Time2Min(cTime){
var min = 0
var hr = 0
cTime = cTime.toLowerCase();
// civilian time
if (/(\d{0,2})[:](\d{2})[ ]?([ap])/.test(cTime)) {
   hr =  Number(RegExp.$1);
   if (RegExp.$3 == "p") {
      hr += 12;
   min = (60 * hr) + Number(RegExp.$2);
   } // end civilian time
// 24 hour time
if (/(\d{0,2})[:](\d{2})/.test(cTime)) {
   min = (60 * Number(RegExp.$1)) + Number(RegExp.$2);
   } // end 24hour time
// military time
if (/(\d{0,2})(\d{2})/.test(cTime)) {
   min = (60 * Number(RegExp.$1)) + Number(RegExp.$2);
   } // end military time
return min;
} // end function
function Min2HH:MM (nMinutes) {
return util.printf("%,1 01.0f" + ":" + "%,1 02.0f", Math.floor(nMinutes / 60), Math.floor(nMinutes % 60));
var elapsed = 0;
var sEnd = "1600"; // change for field value as string
var sStart = "0900" // change for field value as string
// add loop to go through fields:
if (sEnd != "" & sStart !="") {
elapsed += (Time2Min(sEnd)  - Time2Min(sStart)) ;
// end of loop
// format the output
Min2HH:MM(elapsed);

Similar Messages

  • Work Field In Resource Sheet

    The Work field in the Resource Sheet is calculated total hours for each resource based on the Duration in the Gantt chart. However, I have another field in the Gantt chart named Duration1 and I want Work field in the Resource Sheet to be calculated based
    on Duration1 not Duration. What formula can I use to customize Work field in Resource Sheet?

    Thanks guys! Since, there is no way to keep Duration different from the Actual Duration, I baselined Duration. Now, similarly, I would also like to baseline Work; however, baselined Work doesn't reflect
    input values of Work field. Also, just how Duration and Work data are different in my plan, Actual Duration and Actual Work may also differ. I was able to keep the Work values different from the Duration by changing the Duration task type.
    Is there a way to fix Actual Duration as well so that it's not same as Actual Work?
    Duration = allocated duration to complete the task [Task Type: Fixed Duration]
    Work = time it should take to complete the task [Different from Duration]
    Actual Duration = taken duration to complete the task
    Actual Work = time it took to complete the task
    Also, in Resource Sheet, is there a way to compare Baseline Work with Actual Work for
    each resource as well as Baseline Cost based on Baseline Work with Actual Cost based on Actual Work?
    This would allow us to work in the same plan while comparing the plan (by Start/Finish, Work in Gantt, Work in Resource Sheet, and Cost) before and after implementation. If not, then I guess we can have two copies of the plan (one for before implementation
    and the other for after) with Duration and Work where task type is fixed Duration.
    A few comment: 
    baselined Work doesn't reflect input values of Work field : when you
    save a baseline, the behavior is the same for all data copied in the baseline fields. The current value is stored is the corresponding baseline field. Ie when saving baseline n, work is copied in the baselinework n and duration is copied in the baselineduration
    n.
    Actual Work = time it took to complete the task
    : actual work is the effort and not the time it took to complete the task
    is there a way to compare Baseline Work with Actual Work for each resource :  if you split your screen and display the task form with work
    information, you'll see for each assignment work, actual work, baseline work, remaining work. Another way, if you need it timephased, is to use the resource or task usage views and add the baseline, actual and planned work (double clicking the right part of
    your screen).
    Hope this helps.
    Guillaume Rouyre - MBA, MCP, MCTS

  • Need help created state machine that is time based

    I need help with my labview program. My goal is to write a program that allows the user to turn a toggle button on/off. When they do this it will start a loop witch turns on a digital switch for 45 minutes then off for 30 seconds and on and on till the user toggles the switch off. The timing does not have to be precise. I am using the NI 9476 digital output card.
    I have written the code to turn the switch on/off. I know need to add the looped fuction for on 45 minutes/off 30 seconds. I assume the most efficient method would be using a state machine, but I was having trouble figuring it out.
    Attached is the program I have written thus far without the loops.
    Thanks,
    Barrett
    Solved!
    Go to Solution.
    Attachments:
    Test Setup X01.vi ‏16 KB

    I cannot see your code since I don't have 2010 installed. A state machine would be good approach but in order to allow the user to cancel and possibly abort the process at any time your state machine should have a state such as "Check for timeout". In teh loop containing the state machine use a shift register to pass the desired delay value and the start time time for that particular delay. Once the user starts the process set the delay time to your desired time (45 minutes expressed as seconds) and have another shift register that contains the next state to go to after the delay completes. Use a small delay (100ms to 500ms depending on how accurate you want your times to be) to prevent your state machine from free running and then check the delay again. Use the current time and compare it to the start time. If the desired time has passed then go to the next state. You can store the next state in a shift register. No do the same thing for your Off Time state.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot
    Attachments:
    Simple Delay in State Machine.vi ‏14 KB

  • Help creating a search field in my website for users to search within my site

    Hello .
    Basically i want a search field in my website so visitors can search withing my website for what they are looking for .
    Here is an example website of how i want my search field (search field top right if website)
    http://www.asos.com/
    So if any one can let me no what code i need or what i should do to make this search field happen .
    Im using dreamweaver cs4 . Doing the website in html and using css .
    Thanks allot .
    Rob .

    Go to Freefind.com.  Their free search engine has a few text ads on the results pages.  The paid version is add free.  Customize the look, and search features any way you wish.  After they spider your site (usually within 24 hours), people will be able to search your site. You can see a working example on my site alt-web.com
    Zoom from Wrensoft -- free up to 50 pages with tiered pricing for larger sites. Also works on intranets and CDs.
    And of course there's always Google 
    http://www.google.com/cse/
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web.blogspot.com

  • I need PDF fields to calculate time worked and convert to hours and tenths by set formula

    I have been working on a PDF form which has a "time in" field, "time out" field, "total time" and "accumulated time" fields. I have found a couple of forms online which I tried copying the code and it will not work. There is a formula here that they go by, i.e. 0-3 minutes = 0, 4-9 minutes + .1.
    I found code for the conversion but am a beginner at writing code and I am getting errors in the scripting box which I don't understand.
    Does anyone have code written that would work for the Total Time field that will calculate the time between the in and out fields and convert to a set formula? I can get the accumulated field to work.
    I used this:
    document.write(Math.round(0.60) + "1.0");
    document.write(Math.floor(0.57) + "0.90");
    document.write(Math.floor(0.51) + "0.80");
    document.write(Math.floor(0.45) + "0.70");
    document.write(Math.floor(0.39) + "0.60");
    document.write(Math.floor(0.33) + "0.50");
    document.write(Math.floor(0.27) + "0.40");
    document.write(Math.floor(0.21) + "0.30");
    document.write(Math.floor(0.15) + "0.20");
    document.write(Math.floor(0.09) + "0.10");
    document.write(Math.floor(0.03) + "0.00");
    but am missing code to make it work. I am on Acrobat Pro Extended on a Windows 7 platform.
    Thank you in advance, Annette

    I've developed a script that can automatically add these calculation to
    multiple fields, including the total field.
    Have a look here:
    http://try67.blogspot.com/2011/03/acrobat-calculate-time-differences-in.html
    PS -  document.write() is not a valid method in a PDF.

  • My iMessage does not appear to be working. Every time I go to reply to an existing message it just appears as normal text. I have tried to create a new message but it still just defaults to normal messages. I have checked my settings but looks ok. Help?

    My iMessage does not appear to be working. Every time I go to reply to an existing message it just appears as normal text. I have tried to create a new message but it still just defaults to normal messages. I have checked my settings but it is all set up as it should be. Is there anything I've missed or could try? Thanks

    Try the following:
    In Finder, select the problematic volume and then press command-I.
    Expand the Sharing & permissions section if it's collapsed.
    If the section is locked, then unlock it by pressing the padlock button and then authenticating as directed.
    Tick/check Ignore ownership on this volume.

  • Input Help for TIME type field

    I saw below discussion regarding a dropdown for a "TIME" type field.
    Re: Time Search Help
    It's a resuable component (that Thomas Jung created) and find it very slick.
    I just couldn't make it to work. I'm getting a dump when I pressed the dropdown on the "TIME" field.
    I was wondering, has anyone used this in conjunction with select-options (WDR_SELECT_OPTIONS) ?
    I'm getting a system-dump, "Component usage VALUE_HELP does not exist". I double checked the name that I used on the "USED COMPONENT" tab and it is VALUE_HELP.
    During method ADD_SELECTION_FIELD (for IF_WD_SELECT_OPTIONS) I'm using two parameters I_VALUE_HELP_TYPE = 'APPLDEV' and I_VALUE_HELP_ID = 'VALUE_HELP'.
    Maybe I'm not using the right parameters ?
    Anyway, I would appreciate if anyone could give me directions to correct the problem.Or maybe there is another and better way of having an input help for a "TIME" type field on select-option.
    Thanks.
    Vic

    That is because the TIME is a freely programmed value help and freely programmed value helps are not supported by the Select-Options component.  That limited is listed in the online help:
    Type of input help specified as type IF_WD_VALUE_HELP_HANDLER.
    Note that only ABAP Dictionary-based input help and OVS input help are supported; freely programmable input help is not supported.
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/45/bf07361248003de10000000a11466f/frameset.htm
    The reason for this is that the freely programmed value help is accessed via a component usage.  The Select-Options however are a separate component. They have no declaration to your components, component usages.  Therefore they produce the error that the component usage doesn't exist - which is correct.  It doesn't exist in the Select-Options Component.

  • Help creating Time Tracking spreadsheet in Numbers

    I need to create a spreadsheet to calculate time spent on each of my tasks at work.
    Can you help me?
    WHat formulas would I need to use to calculate the time between the start time and finish time? and what would I need to put into the start and finish time columns to make that end total time calculation work?
    I have been looking for a template but I just can't find one.
    I love the running log in the standard templates that comes with Numbers it has graphs and totals ata glance, I would love to create somethign like this for time spent on each of my tasks.
    Can you point me in the direction of tutorials or ghelp me?

    Here's one possibility:
    Columns C and D extract the TIMEVALUE of the Date and Time value in column B, placing the value in column C if the employee has arrived prior to or at the time shown in C1 or in column D if the arrival time is later than the time in C1.
    Formulas:
    C2, filled down: =IFERROR(IF(TIMEVALUE(B)>TIMEVALUE($C$1),0,TIMEVALUE(B)),"")
    D2, filled down: =IFERROR(IF(TIMEVALUE(B)>TIMEVALUE($C$1),TIMEVALUE(B),0),"")
    The IFERROR envelope is used to produce the 'empty' cells where no time has been entered in column B.
    The chart is a Stacked Bar Chart. Upper and lower limits for the Y axis were set using values calculated for the arrival times entered for January 9 (10:00 AM, 60 minutes late) and January 10 (8:30 AM, 30 minutes early).
    The number of steps was set to 6 to give horizontal grid lines at 15 minute intervals.
    Labels on the Y axis are in a Text box, and mark 15 minute intervals. Adjust line spacing to match these to the grid lines.
    The line at OT (on time) has been added as a shape, pasted to the document and moved into the correct location.
    Regards,
    Barry

  • Problem in creating part time work schedules

    Hello All,
    I have to create some part time work schedules rules for part time employees
    Work: Tuesdays to Fridays
    a)Tues-Thurs 6.5 hours per day   i.e. 9.30 to 5
      9:30 u2013 14:30 work
      14:30 u2013 15:30 - 1hr lunch break
       3:30 u2013 17:00
    b) Friday - 7 hours (9:30 to 14:30)
    Total hours per week are= 26.5
    1) I created one fixed break schedule 14:30 u2013 15:30 (unpaid)
    2) I created 2 Daily work schedules
    Tuesday to Thursday u2013 NOR & (created variant A)
    Only Friday u2013 NOR1
    3) I created one Period work schedule u2013
    P/Time u2013 Mon is FREE, Tue to Thursday as NOR , Fridayas NOR1 & Sat, Sun as FREE
    4) When I try to create Work schedule rule I got stuck in between:
    I configured weekly working hours as 26.5
    I configured monthly & annually working hours.
    But  I had problem to put daily working hours???
    because Tue u2013 Thurs are 19.5 hours (6.5 into 3) & Friday (7Hrs) =26.5
    Hence how to I club both the working patterns in one Work schedule rule???
    Please help me out in same
    Regards,
    Nithi

    niti
    actually i dont have SAP Login here
    in the Table V_T508A
    u define the annul working hours , Monthly working hours  right
    Can u tell wht are the other feilds there
    26.5 hrs is the Combination of two Periodic Work Schedule right ..........if yes
    26.5/31  31 is ur working days
    Edited by: Sikindar on Apr 6, 2009 10:10 AM

  • Help please - have a Nano and a Shuffle and neither are working! The Nano wheel appears to have stopped working - I can't get it to do anything. I've done the reset,it worked the first time but not since. And the shuffle won't sync with my library!

    Hi,
    I have an iPod shuffle 4th generation and an iPod Nano 5th generation . The Nano wheel appears to have stopped working - I can't get it to play or anything. I've done the reset and it worked the first time, but now the only way I can get it to play anything is to shake it and go with the shuffle choices - I can't change volume, song, pause or turn it off.
    So, I decided to start using the Shuffle which I was given as a present last year. I've plugged it into my laptop (running windows 8 and newest version of iTunes). It appears in iTunes on the left hand side, but when I click to sync (whether I tick sync all or choose artists) it says synched but has no music. It seems to not be linked to the music library - when I tick synch all songs, next to the "sync music" it says 0 songs?
    Any help to fix either would be really appreciated - I'm without any music at the moment and I'm going away this weekend!
    Thanks

    Hi Bblairjones,
    If you are having issues with your Nano and Shuffle, you may want to try the Troubleshooting Assistants on the following page:
    Apple Support: iPod Troubleshooting Assistants
    http://www.apple.com/support/ipod/five_rs/
    Regards,
    - Brenden

  • Since itunes and apple tvs latest update I have had problem wtching movies on apple tv via my itunes can any one help, movie takes a very long time to load sometimes never, it use to work really well, whats going on please help?

    Since itunes and apple tvs latest update I have had problem wtching movies on apple tv via my itunes can any one help, movie takes a very long time to load sometimes never, it use to work really well, whats going on please help?

    You might find useful information in item D1 of Time Machine Troubleshooting.

  • Please help me. My YouTube app will not work. Every time I open it says 'cannot connect to youtube'. I have searched for help and tried resetting my settings and rebooting my ipad2 but nothing has solved the issue.

    Please help me. My YouTube app will not work. Every time I open it says 'cannot connect to youtube'. I have searched for help and tried resetting my settings and rebooting my ipad2 but nothing has solved the issue.

    Yes, I am connected to the Internet through my wifi. Everything is working fine with the e  eption of youtube.  I have reset all Internet settings and have tried synching to iTunes followed by rebooting.  This is all the advice I have found although none of it has been helpful.
    Has anyone else encountered this problem?

  • I made upgrade for IOS to 7.04 but my iphone is second hand and when iphone need to make activation ,i don't have the apple ID so my iphone didn't work from this time so please help me urgent

    I made upgrade for IOS to 7.04 but my iphone is second hand and when iphone need to make activation ,i don't have the apple ID so my iphone didn't work from this time so please help me urgent.

    There isn't one.
    amrzaky wrote:
    I can't contact with previous owner s i need another solutoin
    The Apple ID and Password that was Originally used to Activate the iDevice is required.
    If you cannot get this information from the seller
    Removing a device from a previous owner’s account
    You need to return the Device for a refund, as you will not be able to re-activate it.

  • Please help. At work we have netgear and tplink. Since I updated my mini iPad and iPhone 4S with ios 7 and wifi drops all the time.

    Please help. At work we have netgear and tplink. Since I updated my mini iPad and iPhone 4S with ios 7wifi drops all the time.  What is the problem?

    Try this  - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.) No data/files will be erased. http://support.apple.com/kb/ht1430
    Some things to try first:
    1. Turn Off your iPad. Then turn Off (disconnect power cord for 30 seconds or longer) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    2. Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
    3. Change the channel on your wireless router (Auto or Channel 6 is best). Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    4. Go into your router security settings and change from WEP to WPA with AES.
    5.  Renew IP Address: (especially if you are drooping internet connection)
        •    Launch Settings app
        •    Tap on Wi-Fi
        •    Tap on the blue arrow of the Wi-Fi network that you connect to from the list
        •    In the window that opens, tap on the Renew Lease button
    6. Potential Quick Fixes When Your iPad Won’t Connect to Your Wifi Network
    http://ipadinsight.com/ipad-tips-tricks/potential-quick-fixes-when-your-ipad-won t-connect-to-your-wifi-network/
    ~~~~~~~~~~~~~~~~~~~~~~~~~
    Fix WiFi Issue for iOS 7
    http://ipadnerds.com/fix-wifi-issue-ios-7/
    iOS 6 Wifi Problems/Fixes
    Wi-Fi Fix for iOS 6
    https://discussions.apple.com/thread/4823738?tstart=240
    How To: Workaround iPad Wi-Fi Issues
    http://www.theipadfan.com/workaround-ipad-wifi-issues/
    Another Fix For iOS 6 WiFi Problems
    http://tabletcrunch.com/2012/10/27/fix-ios-6-wifi-problems-ssid/
    Wifi Doesn't Connect After Waking From Sleep - Sometimes increasing screen brightness prevents the failure to reconnect after waking from sleep. According to Apple, “If brightness is at lowest level, increase it by moving the slider to the right and set auto brightness to off.”
    Fix For iOS 6 WiFi Problems?
    http://tabletcrunch.com/2012/09/27/fix-ios-6-wifi-problems/
    Did iOS 6 Screw Your Wi-Fi? Here’s How to Fix It
    http://gizmodo.com/5944761/does-ios-6-have-a-wi+fi-bug
    How To Fix Wi-Fi Connectivity Issue After Upgrading To iOS 6
    http://www.iphonehacks.com/2012/09/fix-wi-fi-connectivity-issue-after-upgrading- to-ios-6.html
    iOS 6 iPad 3 wi-fi "connection fix" for netgear router
    http://www.youtube.com/watch?v=XsWS4ha-dn0
    Apple's iOS 6 Wi-Fi problems
    http://www.zdnet.com/apples-ios-6-wi-fi-problems-linger-on-7000004799/
    ~~~~~~~~~~~~~~~~~~~~~~~
    iPad: Issues connecting to Wi-Fi networks
    http://support.apple.com/kb/ts3304
    How to Boost Your Wi-Fi Signal
    http://ipad.about.com/od/iPad_Troubleshooting/a/How-To-Boost-Your-Wi-Fi-Signal.h Mt
    Troubleshooting a Weak Wi-Fi Signal
    http://ipad.about.com/od/iPad_Troubleshooting/a/Troubleshooting-A-Weak-Wi-Fi-Sig nal.htm
    How to Fix a Poor Wi-Fi Signal on Your iPad
    http://ipad.about.com/od/iPad_Troubleshooting/a/How-To-Fix-A-Poor-Wi-Fi-Signal-O n-Your-iPad.htm
    iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    WiFi Connecting/Troubleshooting http://www.apple.com/support/ipad/wifi/
    How to Fix: My iPad Won't Connect to WiFi
    http://ipad.about.com/od/iPad_Troubleshooting/ss/How-To-Fix-My-Ipad-Wont-Connect -To-Wi-Fi.htm
    iOS: Connecting to the Internet http://support.apple.com/kb/HT1695
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Connect iPad to Wi-Fi (with troubleshooting info)
    http://thehowto.wikidot.com/wifi-connect-ipad
    10 Ways to Boost Your Wireless Signal
    http://www.pcmag.com/article2/0,2817,2372811,00.asp
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
    Fix Slow WiFi Issue https://discussions.apple.com/thread/2398063?start=60&tstart=0
    How To Fix iPhone, iPad, iPod Touch Wi-Fi Connectivity Issue http://tinyurl.com/7nvxbmz
    Unable to Connect After iOS Update - saw this solution on another post.
    https://discussions.apple.com/thread/4010130
    Note - When troubleshooting wifi connection problems, don't hold your iPad by hand. There have been a few reports that holding the iPad by hand, seems to attenuate the wifi signal.
    Some Wi-Fi losses may stem from a problematic interaction between Wi-Fi and cellular data connections. Numerous users have found that turning off Cellular Data in Settings gets their Wi-Fi working again.
    You may have many apps open which can possibly cause the slowdown and possibly the loss of wifi. In iOS 4-6 double tap your Home button & at the bottom of the screen you will see the icons of all open apps. Close those you are not using by pressing on an icon until all icons wiggle - then tap the minus sign. For iOS 7 users, there’s an easy way to see which apps are open in order to close them. By double-tapping the home button on your iPhone or iPad, the new multitasking feature in iOS 7 shows full page previews of all your open apps. Simply scroll horizontally to see all your apps, and close the apps with a simple flick towards the top of the screen.
    Wi-Fi or Bluetooth settings grayed out or dim
    http://support.apple.com/kb/TS1559
    ~~~~~~~~~~~~~~~
    If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
     Cheers, Tom

  • SOMEONE PLEASE HELP ME THIS IS MY FIRST TIME DOING THIS MY IPOD IS DISABLED AND IT SAID CONNECT TO I TUNES I DID THAT AND ITS NOT WORKING HELP ME PLEASE AND THANK U

    SOMEONE PLEASE HELP ME THIS IS MY FIRST TIME DOING THIS MY IPOD IS DISABLED AND IT SAID CONNECT TO I TUNES I DID THAT AND ITS NOT WORKING HELP ME PLEASE AND THANK U

    Please turn off your caps lock.
    See http://support.apple.com/kb/HT1212.

Maybe you are looking for