I have the date values in this format:
StartDate = 7/7/2023 12:00:00 AM EndDate = 7/30/2023 12:00:00 AM
I want to pass these to REST API call in this form:
{"from":"2023-07-07T00:00:00+00:00","to":"2023-30-07T23:59:59+00:00"}'
I tried using DateTime.ToText but getting 400 bad request.
DateTime.ToText
is the solution for this. 400 request is client side issue. Check your connectivity.Implement it with “format” string and
DateTime.ToText
strRangeStart = DateTime.ToText(RangeStart,[Format="yyyy-MM-dd'T'HH:mm:ss'Z'", Culture="en-US"]),