What is the Standard way to Parse different Dates passed as Query-Params to the REST API?
问题 I am working on a REST API which supports Date as a query param. Since it is Query param it will be String. Now the Date can be sent in the following formats in the QueryParams: yyyy-mm-dd[(T| )HH:MM:SS[.fff]][(+|-)NNNN] It means following are valid dates: 2017-05-05 00:00:00.000+0000 2017-05-05 00:00:00.000 2017-05-05T00:00:00 2017-05-05+0000 2017-05-05 Now to parse all these different date-times i am using Java8 datetime api. The code is as shown below: DateTimeFormatter formatter = new