Month Names Constant

This is a pretty silly question, but I haven’t been able to find the
answer. Does Ruby or Rails have a built in constant for the English
month names i.e. January, February etc. or do I have to make my own?

Thanks,

John

Date does (Ruby class)

http://www.ruby-doc.org/stdlib/libdoc/date/rdoc/index.html

irb:

require ‘date’

Date::MONTHNAMES
=> [nil, “January”, “February”, “March”, “April”, “May”, “June”,
“July”, “August”, “September”, “October”, “November”, “December”]

Date::ABBR_MONTHNAMES
=> [nil, “Jan”, “Feb”, “Mar”, “Apr”, “May”, “Jun”, “Jul”, “Aug”,
“Sep”, “Oct”, “Nov”, “Dec”]

Date::ABBR_MONTHNAMES[3]
=> “Mar”

On May 11, 3:42 am, John T. [email protected]

michael_teter wrote:

Date does (Ruby class)

Excellent, that’s just what I need. Thanks!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs