Posted By

alexwilliams on 01/01/07


date format rails ruby helper

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Formatting a date with or without the time

 / Published in: Ruby

  1. def format_date(date, use_time = false)
  2. if use_time == true
  3. ampm = date.strftime("%p").downcase
  4. new_date = date.strftime("%B %d, %Y at %I:%M" + ampm)
  5. else
  6. new_date = date.strftime("%B %d, %Y")
  7. end
  8. end

Report this snippet  


RSS Icon Subscribe to comments
Posted By: Jacky888 on September 29, 2018

review speaker friengood solar bluetooth 50 hours topportablespeaker

Posted By: Jacky888 on October 14, 2018

vodafone smart n8 vfd610 vfd 610 firmwareupdatepro

You need to login to post a comment.