Sure. I did this quickly, so it probably could be simplified. But this formula rounds the current time into half-hour increments:
If you're interested in quarter-hour increments, you would use (1/96) rather than (1/48) in the formula.
Hope this helps,