How do credit cards calculate the exchange rate?

I know many credit cards can add on a 2-3% surcharge for using a credit card overseas but what rate do they charge for the currency conversion?

Do they take the market rate at the exact time of the transaction or do they use the market rate at the close of the business day?

Or do they use a rate determined each morning and posted on the sponsoring bank website – to which it’s better to check their rates before making a purchase.

It is based upon spot market the date of the transaction plus their procesing fee