Skip to main content
Question

Clock in/out round to the nearest quarter hour

  • December 27, 2017
  • 0 replies
  • 59 views

I have added time card functionality in my application using the Essentials Employee Clock In/Clock Out app as a reference. I have the time cards working really well but I was wondering if there was a way to round the time in/out to the nearest quarter hour? I don't want our payroll person to have to deal with a clock in of 8:23am. Instead I would like 8:23am to get rounded up to 8:30am with 8:22am being rounded down to 8:15am
This topic has been closed for replies.

  • Registered
  • December 27, 2017
You could have a field where the employee's entry is recorded, then you could have a second field that is rounded.
Maybe something like
Round(ToNumber(EmpTime),.25)
You'd have to turn it back into a time
Idk if you can round times w/o turning it to a number?

There's prob a cleaner solution but at least that's something.
And no i didn't test it, it's 1 AM and I need to go home.
Let me know how it goes though :)

Try this

var duration RoundedDurationFromMidnight =

Round([My Time Of Day Field] - ToTimeOfDay("12:00 am"), Minutes(15));

ToTimeOfDay("12:00 am") + $RoundedDurationFromMidnight



I had a look and the Round function will round durations, but not a TimeOfDay field.

So, my cheat is to change the time of day into the duration from Midnight, and round that Duration.  But now we have a duration and we need a TimeOfDay.  So then I add that Duration to midnight,  to get back to the Time Of Day rounded.