on ‎2016 Aug 25 2:31 PM
Hi,
We have a Gateway service with some date fields (ABAP datatype DATS converted to Edm.DateTime or Edm.DateTimeOffset).
When service is called with output format JSON, date values are represented in MicrosoftDateFormat format (e.g. "/Date(1448841600000)/").
In contrary, when output format is XML, dates are in ISO-8601 format: YYYY-MM-DDThh:mm:ssTZD (e.g. 1997-07-16T19:20:30+01:00).
Is there any way to change the JSON date format, either in field level or system level?
Request clarification before answering.
Hi Shai,
Unfortunately those are the standard ones for XML(ISO-8601) and JSON (Epoch) respectively.
If you want to change the output at system level for JSON, use an EDM.String to represent the formated datetime you want. For UI which will use the Epoch datetime, there are several libraries that convert Epoch to human readable time. Our UI devs prefer the latter but it depends on your requirement.
Regards,
Francis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.