The typical way of writing dates in Spanish is following this pattern:
- 5 de enero de 2012 (January 5, 2012)
- 21 de febrero de 2019 (February 21, 2019)
Note that in Spanish the name of the month isn't capitalized. You can also spell out the number (as in cinco de enero de 2012), but this is less common than the format above.
In parts of Latin America, especially in areas with U.S. influence, you may also see the form "enero 5 de 2012" in occasional use.
Sometimes, but not often, you may see a period used in the year, as in 2.006.
You should not imitate English by using forms such as tercero de marzo as a direct translation of "third of March." The one exception is that you may say "primero" for "first," so "January 1st" can be said as primero de enero. In numeral form, that's 1o, or a "1" followed by superscripted "o," not a degree sign. Less commonly, the form 1ero is used.
In abbreviated form, Spanish typically follows a day-month-year pattern using a capitalized Roman numeral for the month. The units may be separated by spaces, slashes or hyphens. Thus the abbreviated form of July 4, 1776, can be written in these ways: 4 VII 1776, 4/VII/1776, 4-VII-1776. They're the equivalent of 7/4/1776 in American English or 4/7/1776 in British English.
Common forms used for "B.C." are aC and a. de C. (for antes de Cristo, "before Christ"), with variations in punctuation and sometimes the use of J.C. (Jesucristo) instead of C. In scholarly writing, you may use AEC as the equivalent of the English "BCE," antes de la Era Común or Before the Common Era.
The equivalent of "A.D." is después de Cristo, abbreviated d. de C. or dC with the same variations as noted above. You also may use EC (Era Común) for "CE" (Common Era). The abbreviations AEC and CE are even less commonly used in Spanish than their English equivalents are in English, and aren't universally understood, so they normally shouldn't be used unless demanded by the context.
Pronunciation of years: The years in Spanish are pronounced the same as other cardinal numbers are. Thus, for example, the year 2040 would be pronounced as "dos mil cuarenta." The English custom of pronouncing the centuries separately — in English we typically say "twenty forty" instead of "two thousand forty" — is not followed. Saying "veinte cuarenta" instead of "dos mil cuarenta" would strike native Spanish speakers as an anglicism.