/ Published in: Ruby
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
def format_date(date, use_time = false) if use_time == true ampm = date.strftime("%p").downcase new_date = date.strftime("%B %d, %Y at %I:%M" + ampm) else new_date = date.strftime("%B %d, %Y") end end