def format_date(time : Time) month = get_month(time.month) "#{month} #{time.day}, #{time.year}" end def format_date_with_time(time : Time) month = get_month(time.month) "#{month} #{time.day}, #{time.year} #{time.hour}:#{time.minute} #{am_or_pm(time.hour)}" end def get_month(month) case month when 1 "January" when 2 "February" when 3 "March" when 4 "April" when 5 "May" when 6 "June" when 7 "July" when 8 "August" when 9 "September" when 10 "October" when 11 "November" when 12 "December" end end def am_or_pm(hour) if hour > 12 "PM" else "AM" end end