1. No one shall be held guilty of any criminal offence on account of any act or omission which did not constitute a criminal offence under national law or international law at the time when it was committed. Nor shall a heavier penalty be imposed than that which was applicable at the time the criminal offence was committed. If, subsequent to the commission of a criminal offence, the law provides for a lighter penalty, that shall be applicable.2. This Article shall not prejudice the trial and punishment of any person for any act or omission which, at the time when it was committed, was criminal according to the general principles recognised by the community of nations.3. The severity of penalties must not be disproportionate to the criminal offence.
EU Charter of Fundamental Rights
Article 49 – Principles of legality and proportionality of criminal offences and penalties