Take the 2-minute tour ×  I'm building an application to record
when my cat has an asthma attack. I'm not interested in the
exact time since glancing at the time in interval of 15 minutes
is easier to review (e.g. rounding 9:38am should be recorded as
9:45am).  I looked for a UDF at cflib.org for this but couldn't
find one. I tinkered with CF's round function but I'm not
getting it to do what I want.  Any advice?  share|improve this
question add comment  4 Answers  up vote 5 down vote accepted
This could do with a bit more polish (like data type validation)
but it will take a time value and return it rounded to the
nearest 15-minute increment.  function roundTo15(theTime) {
var roundedMinutes = round(minute(theTime) / 15 ) * 15;     var
newHour=hour(theTime);     if (roundedMinutes EQ 60) {
newHour=newHour + 1;     return
timeFormat(createTime(newHour,roundedMinutes,0),"HH:mm");
share|improve this answer everett Perfect or as my cat would
say, Purrrrrfect. ;) As written, does this account for the