If you put the day before the month, use the definite article before the day and the preposition of before the month.
5 October 2004 - the fifth of October, two thousand and four
If you put the month before the day, use the definite article before the day in British English. In American English, the definite article can be dropped.
October 5, 2004 - October (the) fifth, two thousand and four