#31 Formatting Time

Learn how to use the trusty strftime method to format a time, and see how Rails allows you to save this format for later use.
# config/environment.rb
Time::DATE_FORMATS[:due_time] = "due on %B %d at %I:%M %p"
<%= task.due_at.to_s(:due_time) %>

你可能感兴趣的:(java,Rails)