All twelve months in German are masculine, every single one, with no exceptions, no edge cases, and nothing to check. You know it's a month, you know the article is der.
The rule
Every month is masculine. That means der in the Nominativ, and the masculine forms follow through every case. You never need to check. The category itself determines the article.
| Month | English |
|---|---|
| derJanuar | January |
| derFebruar | February |
| derMärz | March |
| derApril | April |
| derMai | May |
| derJuni | June |
| derJuli | July |
| derAugust | August |
| derSeptember | September |
| derOktober | October |
| derNovember | November |
| derDezember | December |
The seasons too
The pattern extends to the seasons. All four are masculine as well → derFrühling (spring), derSommer (summer), derHerbst (autumn), derWinter (winter). No exceptions there either.
Months, days, seasons: if it marks a point in time on the calendar, German almost always reaches for masculine. It's not a rule you derive, it's a pattern you recognise, and once you've seen it, it stops being something you think about at all.
In conversation
Most of the time you'll hear months like this: in + dem January (= im Januar), in + dem February (= im Februar), in + dem March (= im März). That im is a contraction of in and dem. That's Dativ. And Dativ is exactly what you'd expect: der becomes dem, just like every other masculine noun.
You know it's a month, so you know it's der, for all twelve months and all four seasons, no checking and no guessing required.