Need to custom format a ruby date object? -


how format ruby date following? sep14.2016

it looks format 3 characters of month followed 2 characters of day period , year.

d = date.parse('14 september 2016') 

to date object.

d.strftime('%b%d.%y') #=> sep14.2016 

this format date wanted. keep in mind d not modified, still date object. need assign result of strftime method variable.

you can use downcase method remove capitalization.


Comments