the month is always in genitive. Cf. also the following:
"В первых числах января". "Первые числа" literally 'the frist numbers' , to mean 'in/during the first days OF January'. "В январе, 7го числа".
More coloquial:
"какое сегодня число?", "15го числа", "в 20-х числах" etc.
Or formal, even bureaucratic: "15-числа, января месяца, 1999 года"
"15-го дня января месяца" is older construction, like 19 century.
So just consider some noun - 'day' or 'number' was between '15th' and 'of January', but later dropped. 15th. thus behaves like an adjective defining the noun, and take the same case as the noun would take:)))
--- below a table with examples, but I don't think you need to memorize it. It is regular.
The number can take virtually any case)
"сегодня - 15е января" (Nom.)
"'я разговаривал с Kelsey 20-го января" (gen. [it happened] 20 January).
К 15-му январю (dat. here after preposition 'к', 'to', governing dat. You may think of any other usage of dative, like "I dedicate it to 15 january" etc.).
Accusative would conicide with nom. It comes after any transitive verb, like "I imagine 15th January".
"письмо датированное пятнадцатым января". (colloquially also пятнадцатым январём:)).
"за" ('behind'): за пятнадцатым (prep) января следует (follows) 16-е. (nom).
Now prepositional case. It happens
1) in 'locative' function, i.e. after "в", "на" in their meaning of 'location', not 'direction'. But here we have something anomalous. See comment.
2) О 15-м января. About 15th ...