Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Discrepancy between `date.to_s(:long)` and `l(date, format: :long)` #14237

gabrielecirulli opened this Issue · 2 comments

4 participants


This is happening on my Rails 4.0.3 app but seems to also be present in master.

There seems to be a discrepancy between the :long format defined in Date::DATE_FORMATS (%B %e, %Y) and the one defined in the default locale/en.yml (%B %d, %Y).

Namely, the %e parameter in the former causes the rendered date to have two spaces between the month and the day when the day is single-digit, due to the fact that it pads the day number with spaces. The latter instead pads the day number with zeroes.

Is this discrepancy known of? I discovered it today while testing, because I used to_s(:long) in my test and the l helper in my view.

In my opinion, the date should be displayed without leading zeros on the day but also without repeated spaces. A format string of %B %-e, %Y seems to accomplish this.


Hey Gabriele! I've also been able to reproduce and using your format string suggestion really seems to fix it. (: I'll make a PR soon.

@senny senny added the attached PR label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.