Copy link to clipboard
Copied
Good day!
I have created a form with the following fields:
All the dates have the format dd/mm/yyyy. Example: 01/09/ 2022 for September 1, 2022
All the times have the format hh:ss tt. Example: 2:30 for 2 hours and 30 second
What I want to happen is:
2. Then get the difference between the Start Date and Time and Finish Date and Time. Results should be the number of hours with 1 decimal place.
3. Subtract the Unbillable Hours from the Step 2 result.
Example:
Start Date and Time = 31/08/2022 10:00 pm
Finish Date and Time = 01/09/2022 06:30 am
Unbillable Hours = 2 hours
If I compute this manually, it would be 7.5 Hours less 2 unbillable hours equals 5.5 hours.
How do I do this?
If this cannot be done, I will be happy to have a solution if dates are not included. This means that the given are Start Time, Finish Date and Unbillable Hours.
Thank you in advance.
Copy link to clipboard
Copied
A small error corrected!
You can remove the script of the Unbillable Hours field, but you will get an error if you enter a anything else than a number in this field.
@+
Copy link to clipboard
Copied
This can be done, and there are a lot of dates time scripts on these forums try to research a bit and then post your solution, and we will help you.
Or if it's too much for you, you can always hire someone to do it for you.
Copy link to clipboard
Copied
Hi Asim123,
Thank you for replying.
Before I posted my question, I tried to search here for a possible solution. The problem is zero knowledge about scripting. Apology for this.
I don't mind hiring someone (as you suggested) to provide the solution to my question. I just need to know you much would it cost me and how should I be paying.
Thank you..
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hi Bebarth,
Thank you for correcting me on my computation. You are right, the answer should be 6.5.
Appreciate the solution you have provided. This is exactly the solution I am looking for.
When I tried to substitute the fieldnames in your script with the actual fieldnames in my fillable PDF, it didn’t work. This my mistake but couldn’t figure it out what is wrong. Like I mentioned, I have zero knowledge in scripting.
I might be requesting too much from you. But would you be kind enough to help me out again? I know such a thing is too much to ask but for someone like you, this is easy.
Here are the changes I would like to so I can just do cut-and-paste the script into my fillable PDF and make the
F02001a Start Date (dd/mm/yyyy)
F02001d Start Time (hh:mm tt)
F02001e Finish Time (hh:mm tt)
If this is too much favor, I am willing to compensate you for your effort. Thanks.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hi Bebarth,
Appreciate the effort you did here.
I downloaded Example_BB.pdf and when I tried it by entering the following:
Date = 02/09/2022
Start Time = 8:00 am
Finish Time = 6:00 pm
Unbillable Hours = 2
It gives me a message "The end time must be after the start time."
Also, is the script in Unbillable Hours under the Format tab, necessary? Can I delete that? Thanks.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Your last solution works perfectly. I guess the problem is from my end. Appreciate the help.
Please let me know how I can compensate you for your effort. How much do I owe you? I have PayPal account. I can settle my outstanding through this platform. Send me this information privately as I don't think such information is allowed here or you can email me at henryfuaong@yahoo.com. Thank you.
Copy link to clipboard
Copied
It's for me... 😉
@+
Copy link to clipboard
Copied
Thank you Bebarth for the help. I really appreciate your effort.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more