I have the following method which accepts two date parameters in ISO 8601 format. However, when I print these dates I am losing the seconds, milliseconds and the timezone 'Z'. How do I retain the entire date even if the seconds and milliseconds are 0?
@RequestMapping(method=RequestMethod.GET, value="/status")
public StatusObject getStatus(@RequestParam("id") String id,
@RequestParam("startTime")@DateTimeFormat(iso=DateTimeFormat.ISO.DATE_TIME) LocalDateTime startTime,
@RequestParam("endTime")@DateTimeFormat(iso=DateTimeFormat.ISO.DATE_TIME) LocalDateTime endTime) throws Exception{
StatusObject statusObject = null;
System.out.println("startTime: "+ startTime);
System.out.println("endTime: "+ endTime);
return statusObject;
}
Output: startTime: 2018-05-03T15:00 endTime: 2018-05-03T18:00