I'm not sure if there is an existing way that is clean.... but here is the beginings of a possible solution?
SECONDS_IN_DAY = 60*60*24 time_of_post = Time.gm(2000,"jan",1,20,15,1).to_i
if (Time.now.to_i - time_of_post) <= SECONDS_IN_DAY # print 'today' elsif (Time.now.to_i - time_of_post) <= SECONDS_IN_DAY*2 # print 'yesterday' else # use distance_of_time_in_words end