
I am passing a date-time 31-05-2019 23:59:59 in query string using swagger UI but getting an exception for invalid date-time. Please see attached screenshot.
The DateTime must conform to ISO-8601 format which is yyyy-MM-dd'T'HH:mm:ssZ and therefore you should change the date-time to 2019-05-31T23:59:59Z before you pass it to the query. Note that Z stands for Zulu and specifies UTC+00:00. If your date-time value has some other zone-offset, specify that in the format, ("+" / "-") time-hour ":" time-minute e.g. 2019-05-31T23:59:59+05:30 which specifies a date-time with a timezone offset of 5 hours and 30 minutes (India Standard Time).
Given below is an excerpt from Swagger Data Types:
An optional format modifier serves as a hint at the contents and format of the string. OpenAPI defines the following built-in string formats:
date – full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21date-time – the date-time notation as defined by RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z