1

I try convert Long to date in Rest API spring java as blow :

@RequestParam(value = "startDate", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ")Date startDate

this is my URL .../schedule?startDate=1496011479000 and i get error : nested exception is java.lang.IllegalArgumentException: Invalid format: \"1496011479000\" is malformed at \"9000\""

what is wrong ?

Adam
  • 1,041
  • 1
  • 7
  • 22
  • you can change type of startDate to long, and remove other annotations. and in method, you can convert that startDate to Date using `Date d = new Date(startDate).` – Sachin Gupta May 04 '17 at 05:04
  • @SachinGupta : it's resolve problem so inconvenient. – Adam May 04 '17 at 05:45

0 Answers0