I am trying to create a form with a field that calculates total hours worked from 'time in'/'time out' fields. I need to use the h:mm tt format, and I need to use regular time as opposed to military time. Please help!
I am trying to create a form with a field that calculates total hours worked from 'time in'/'time out' fields. I need to use the h:mm tt format, and I need to use regular time as opposed to military time. Please help!
You need to realize that date and time values are not numbers but a standard formatted character string (the delimiters are not considered a numeric sign nor decimal point) and will need to be converted to a number like a minute or millisecond before any calculation can be preformed.
This requires a fair amount of coding and much of that coding is repeated several times with only a minor change of a field name for value. This type of coding can be reduced by using a couple of functions to minimize the coding effort. Possible functions is to convert a time value to a single standard time unit (minutes or milliseconds) for performing the calculations.and to convert a single time unit (minutes or milliseconds) to a display format or value.
Are you trying to create a time sheet. If so, then you need to compute and display the difference for each day, and then compute the total of the daily elapsed times by converting them back to a single value, summing the values and then formatting the result for display. Note that the default time formats provided by Adobe are for time within a day and can not exceed 24 hours, since there are no more than 24 hours in a day. The computations get more numerous if you are going to provide for a lunch break and how you provide that data.
Since you are using Acrobat Standard you do not have direct access to document level script editing.
George Kaiser