I'd take a look at regular JavaScript sources, there are some examples around. The math is a bit much for me...http://stackoverflow.com/questions/5616600/time-interval-in-15-minutes-increment-formathttp://stackoverflow.com/questions/4968250/how-to-round-time-to-the-nearest-quarter-hour-in-javascript