Rails 2.3.5 / Ruby 1.8.7
For a datetime record field, is there a Time method that would make it possible to say “if this time is > 5am this morning” in a single line?
Like:
<td>
<% if my_data.updated_at > 5am this morning %>
Valid
<% else %>
Expired
<% end %>
</td>
I guess otherwise it woudl be storing now(), changing it’s ‘hour’ property to ’05’ and then comparing the datetime field to that?
Thanks – Working with Times is still confusing to me for some reason.
1 Answer