Code Geass is set in an alternate history. I thought that was pretty obvious... The first episode etablishes the date with "a.t.b. 2017" or "Imperial Calendar" if you watched the American dub.
Quote from
Wikipedia: This divergence in history causes many other differences: the retaining of absolute monarchy, the
suppression of the American colonies' rebellion in 1776 and the
conquering of the American continents.