Clive Portman: code

Add leading zeros to single digit numbers using Twig

Useful when you need to convert single digit days or months to having a leading zero using Twig:

{{ "%02d"|format(dayInMonth) }}

Hat-tip.