Skip to main content
Solved

Time input, per 15 minutes


The Boulder Guy
Rookie

One of our customers wnats to “force” his employees to work in timeframes of 15 minutes.

So quick question: Is there a way you can controle the input for times in steps of 00, 15, 30 and 45 minutes?

I wasn't able to find this answer on the community, sorry if I didn't search hard enough for it. A redirect would be appriciated in that case :)

Best answer by Anne Buit

This is currently not possible with a datetime picker. You’d need to set up a date picker and have a subsequent hour-picker combobox and quarter-hour-picker combobox.

Feel free to submit an idea in the Ideas section to allow for configuration of the steps in a time or datetime picker like this.

View original
Did this topic help you find an answer to your question?

5 replies

Anne Buit
Community Manager
Forum|alt.badge.img+5
  • Community Manager
  • 637 replies
  • March 26, 2025

Hi, you can set up Default logic that rounds the input to the desired times.

 

declare @datetime datetime2(0) = sysutcdatetime()

-- Strip seconds
set @datetime = dateadd(second, -datepart(second, @datetime), @datetime)

-- Round down to last quarter hour
set @datetime = dateadd(minute, -datepart(minute, @datetime) % 15, @datetime)

select @datetime

 

Edit: I’ve been tinkering with this a bit; you can even make it quicker by simply taking the minutes since the base date (0 - 1900-01-01), dividing them by 15 (effectively rounding down), multiplying them by 15 again and adding them to the base date again.

declare @datetime datetime2 = sysutcdatetime()

-- Add rounded-down full quarter hours since base date to the base data
set @datetime = dateadd(minute, datediff(minute, 0, @datetime) / 15 * 15, 0)

select @datetime

Downside is that quarter hours before the year 1900 are rounded up 😂


The Boulder Guy
Rookie

Awesome! Thanks for the quick reply. I will forward this information to my team.


The Boulder Guy
Rookie

@Anne Buit Thanks again for the response.

But the wish is to have controle of what the user can input. We want the user to only see 00, 15, 30 and 45 in the minute dail. Is that possible?


Anne Buit
Community Manager
Forum|alt.badge.img+5
  • Community Manager
  • 637 replies
  • Answer
  • March 31, 2025

This is currently not possible with a datetime picker. You’d need to set up a date picker and have a subsequent hour-picker combobox and quarter-hour-picker combobox.

Feel free to submit an idea in the Ideas section to allow for configuration of the steps in a time or datetime picker like this.


The Boulder Guy
Rookie

Marked it as an idea, thanks again ​@Anne Buit !!
 

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings