Skip to main content
Question

Rounding Time to nearest quarter

  • November 13, 2020
  • 0 replies
  • 120 views

 I was wondering if there was a way to round the time in/out to the nearest quarter hour?

This is my current formula:

var duration RoundedClockIn = Round([Clock In Date Time] - ToTimeOfDay("12:00 am"), Minutes(15));

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

I keep receiving this error "The operator "-" can't be applied on types date/time, timeofday.

Any help would be greatly appreciated 


------------------------------
Wallace Yeboah
------------------------------
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+22
  • Quickbase Alumni
  • November 14, 2020
try this

var datetime MidnightOfClockInDay = ToTimestamp(ToDate([Clock In Date Time]), ToTimeOfDay("12:00 am"));

var duration RoundedDuratonfromMidnight = Round([Clock In Date Time] - $MidnightOfClockInDay, Minutes(15));

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

------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------