There are options:
- Inject the date and format in your bean to return the desired string representation.
- Use the
Formatter
SPI and configure an instance ofDateFormatter
given to you out of the box. Here is the Javadoc. - Implement and register your own instance of
Formatter
and then pass it to@Formatted
annotation. Or use other annotations for more special cases. This is described here.