How to return date from Rest API eg. 1185746400000 OR Custom format like "2021.12.31 22:00:00"?

Viewed 40

What is correct way of returning date from Rest API

This

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy.MM.dd HH:mm:ss")
protected Date changeDate;
validFrom": "2021.12.31 22:00:00", (Any random format using Date or XmlGregorianCalendar etc. or specific format)

Or

private Date startDateConcern;
"startDateConcern": 1185746400000

Preparing a Masterdata API so finding this information. Will that "1185746400000" confusing for my customers?

0 Answers
Related