When the UK was still part of the EU, your passport simply had to be in date in order to travel across the continent. However, since Brexit, rules around how long your passport needs to be valid have changed.
Your passport must meet 2 requirements. It must be:
Check both the issue date and the expiry date in your passport. If you renewed your passport early, extra months may have been added to its expiry date. This could affect the requirement for your passport to be less than 10 years old.
Please check the UK government website for the most up-to-date information.