This article is a list of the prime ministers of Canada by their time in office. The list starts with Confederation on July 1, 1867, and the first prime minister, Sir John A. Macdonald. It includes all prime ministers since then, up to the current prime minister, nor do they have term limits. Instead, they can stay in office as long as their government has the confidence of a majority in the House of Commons of Canada under the system of responsible government. Under this system, Prime Minister Mackenzie King was Canada's longest-serving prime minister, holding office in three non-consecutive terms for a total of twenty-one years and one hundred fifty-four days.