Skip to main content
Participant
February 5, 2024
Question

Need help with script builder for tracking hours in Military Time with 15 min increments

  • February 5, 2024
  • 1 reply
  • 386 views

 

I'm trying to make a form for people to track their hours. My organization makes it be in 15 minute increments and it has to be in military time format. We currently have a drop down with every 15 minutes, and they have to add up their total time themselves. 

 

It would be amazing if I could get a script to have it add automatically. I only know how to do simple equations and it isn't working, plus sometimes they'll start working at 11pm and end at, say 1:30am. Is there a way to make it calculate that as 2.5 hours even though it crosses over midnight?

 

Any help would be appreciated! 

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
February 5, 2024

> Is there a way to make it calculate that as 2.5 hours even though it crosses over midnight?

Yes, but how would it know if that's the case? Let's say the start time is 09:00 and the end time is 10:00. Is that 1 hour, or 25 hours? Or 49 hours? etc.

Chey519Author
Participant
February 6, 2024

Good point! Technically it'll never be for more than one day. Most times will be for 3-6 hours, but ocassionally they go past midnight. Is this a forumla that can even be done with Adobe? Thank you!

try67
Community Expert
Community Expert
February 6, 2024

Yes, it's possible. You can do it by assuming that if the end time is before the start time it takes place on the next calendar date. This type of calculation was discussed here many times in the past, including full code examples. Have you tried searching for some similar key-words?