Year zero
Historians have never included a year zero. This means that between, for example, and , there are 999 years: 500 years BC, and 499 years AD preceding 500. In common usage "anno Domini" 1 is preceded by the year 1 BC, without an intervening year zero. Neither the choice of calendar system (whether Julian or Gregorian) nor the era ("Anno Domini" or Common Era) determines whether a year zero will be used. If writers do not use the convention of their group (historians or astronomers), they must explicitly state whether they include a year 0 in their count of years, otherwise their historical dates will be misunderstood.
Millennium
The ISO 8601, employed in a number of contexts, uses the astronomical calendar, in which year counting starts at 0. Thus, when using this calendar, the millennium starts at x000 and ends at x999. There was a popular debate leading up to the celebrations of the year 2000 as to whether the beginning of that year should be understood (and celebrated) as the beginning of a new millennium. Historically, there has been debate around the turn of previous decades, centuries, and millennia.