Here's why:
* French uses a 24-hour clock: So 6:00 PM is 18:00.
* "Vingt" means twenty: But we don't say "vingt" for minutes past the hour.
* "Quarante" means forty: Since there are 60 minutes in an hour, "twenty to six" is the same as "six minus twenty minutes", or "forty minutes past five".
Therefore, "cinq heures quarante" translates to "five hours forty" or "five forty" in English.