yurko
11/17/2015 - 7:50 AM

time_rounding.rb

t = DateTime.now
t.to_date + (t.min < 30 ? t.hour.hours : t.hour.hours + 30.minutes)