# Dumb question - how to get day/month names from a date?

**URL:** <https://www.ruby-forum.com/t/dumb-question-how-to-get-day-month-names-from-a-date/59798>\
**Category:** Ruby\
**Created:** [May 6, 2006, 8:18pm UTC](https://www.ruby-forum.com/t/dumb-question-how-to-get-day-month-names-from-a-date/59798 "2006-05-06T20:18:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adambeazley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5f9b8f/32.png) [@adambeazley](https://www.ruby-forum.com/u/adambeazley)\
**Post date:** [May 6, 2006, 8:18pm UTC](https://www.ruby-forum.com/t/dumb-question-how-to-get-day-month-names-from-a-date/59798/1 "2006-05-06T20:18:57Z")

</div>

I can’t for the life of me figure this one out. I know that the Date  
class has constants including MONTHNAMES and DAYNAMES, but I have no  
idea how to access them.

day = Date.today  
Date.constants

> [“MONTHS”, “ABBR\_DAYS”, “DAYNAMES”, “ENGLAND”, “DATE\_FORMATS”, “PARSE\_DAYPAT”, “ABBR\_MONTHNAMES”, “ABBR\_MONTHS”, “ITALY”, “PARSE\_MONTHPAT”, “MONTHNAMES”, “GREGORIAN”, “DAYS”, “ZONES”, “ABBR\_DAYNAMES”, “JULIAN”]

day.italy

> #\<Date: 4907723/2,0,2299161\>

day.monthnames

> NoMethodError: undefined method `monthnames’ for #\<Date: 4907723/2,0,2299161\>

How do I access that constant?

-Adam

---

<div class="post-metadata">

**Author:** ![adambeazley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5f9b8f/32.png) [@adambeazley](https://www.ruby-forum.com/u/adambeazley)\
**Post date:** [May 6, 2006, 8:30pm UTC](https://www.ruby-forum.com/t/dumb-question-how-to-get-day-month-names-from-a-date/59798/2 "2006-05-06T20:30:24Z")

</div>

On 5/6/06, Adam B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > #\<Date: 4907723/2,0,2299161\>
> 
> day.monthnames
> 
> > NoMethodError: undefined method `monthnames’ for #\<Date: 4907723/2,0,2299161\>

Date::MONTHNAMES

It’s a constant in the Date class. You use “::” to get at constants,  
“.” to get at methods.

Les
