Thymeleaf: get the current year
The following code returns the current year on Thymeleaf:
${#dates.year(#dates.createNow())}
Example usage
Create a list of options from 1900 up to the current year:
<select >
<option th:each="year : ${#numbers.sequence(1900, #dates.year(#dates.createNow()))}"
th:value="${year}" th:text="${year}">
</option>
</select>