How would I format a date from a Table

This should be simple, but the suggestions from the IDE are leaving me clueless.

For example:

@Inject
private GroupTable jobsTable;
@Subscribe(“printSummaryBtn”)
public void onPrintSummaryBtnClick(Button.ClickEvent event) {
Job job = jobsTable.getSingleSelected();
Date jobDate = job.getJobDate();
}

As it stands, it is delivered in a format that I don’t need, but the auto-suggestions haven’t lead me to a solution. I’d simply like it returned as ‘mm/dd/yyyy’.

I’d really appreciate help on how to do this, or where to find the information. Thanks!

To get the date into the correct format, you need convert it into a formatted string.

The Date type is stored in a generic format that isn’t great for displaying without converting to a formatted string beforehand.

Hi,
To format date/time types to string using user locale settings you should use a DatatypeFormatter bean.

Take a look to this documentation page:
https://doc.cuba-platform.com/manual-7.1/datatype_date_number_format.html

And you could find that link as a first result of searching “format date” in the developer’s manual.
image