When was Kyoto the capital of Japan?

The emperors of Japan ruled from Kyoto from 794 as the new seat of Japan's imperial court for eleven centuries until 1869.