# Getting (say) the month from a gregor datetime

**URL:** <https://racket.discourse.group/t/getting-say-the-month-from-a-gregor-datetime/2355>\
**Category:** Questions & Answers\
**Created:** [October 1, 2023, 2:02am UTC](https://racket.discourse.group/t/getting-say-the-month-from-a-gregor-datetime/2355 "2023-10-01T02:02:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbclements](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/jbclements/32/11_2.png) [@jbclements](https://racket.discourse.group/u/jbclements)\
**Post date:** [October 1, 2023, 2:02am UTC](https://racket.discourse.group/t/getting-say-the-month-from-a-gregor-datetime/2355/1 "2023-10-01T02:02:26Z")

</div>

I like the work and thought that went into gregor. However, I can't figure out how to extract (say) the month from a datetime without doing something crazy like comparing the date to the first of each month. Even that seems impossible without first knowing the year. I hope I'm missing something obvious?

---

<div class="post-metadata">

**Author:** ![AlexKnauth](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/alexknauth/32/242_2.png) [@AlexKnauth](https://racket.discourse.group/u/AlexKnauth)\
**Post date:** [October 1, 2023, 2:06am UTC](https://racket.discourse.group/t/getting-say-the-month-from-a-gregor-datetime/2355/2 "2023-10-01T02:06:33Z")

</div>

Closest thing is probably `period-ref`, which takes a period, not a datetime.

---

<div class="post-metadata">

**Author:** ![AlexKnauth](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/alexknauth/32/242_2.png) [@AlexKnauth](https://racket.discourse.group/u/AlexKnauth)\
**Post date:** [October 1, 2023, 2:07am UTC](https://racket.discourse.group/t/getting-say-the-month-from-a-gregor-datetime/2355/3 "2023-10-01T02:07:16Z")

</div>

Oh, there's also `->month`, which takes a date-provider

---

<div class="post-metadata">

**Author:** ![jbclements](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/jbclements/32/11_2.png) [@jbclements](https://racket.discourse.group/u/jbclements)\
**Post date:** [October 1, 2023, 4:17pm UTC](https://racket.discourse.group/t/getting-say-the-month-from-a-gregor-datetime/2355/4 "2023-10-01T16:17:25Z")

</div>

Ugh, it's right there! How did I spend 5 minutes in those docs and not find it?

...

I wonder how hard it would be to generate a package-specific index that just lists all of the names associated with the package ...

But actually, looking harder, I see that each page has a list much like I'm looking for, low down in the left column. Maybe my real issue is that the gregor docs are broken into SO MANY subpages. Okay, anyway: got what I want, many many thanks!

---

<div class="post-metadata">

**Author:** ![benknoble](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/benknoble/32/16_2.png) [@benknoble](https://racket.discourse.group/u/benknoble)\
**Post date:** [October 2, 2023, 2:08pm UTC](https://racket.discourse.group/t/getting-say-the-month-from-a-gregor-datetime/2355/5 "2023-10-02T14:08:23Z")

</div>

Perhaps an Index would help. I generate one for  
[Frosthaven Manager](https://benknoble.github.io/frosthaven-manager) with  
`@(index-section)`. It has more than just "exported bindings," but  
it's quite helpful.
