SAP Knowledge Base Article - Public

2737845 - Wrong Date Format in OData Query

Symptom

You query a report via OData, however when you check the result, you notice that date time fields are shown in the wrong format. So for example, instead of showing 2019-01-01T00:00:00, the result might return /Date (1545523200000)/

Environment

  • SAP Business ByDesign
  • SAP Cloud for Customer 

Reproducing the Issue

Enter your OData URL which may look like this:

www.<enter your system URL here>/sap/byd/odata/ana_businessanalytics_analytics.svc/RP<enter your report ID here>QueryResults?$top=1000&$format=json

Cause

You have changed the format from xml to JSON by using $format=json. There is no specific date format provided by JSON.

Resolution

Fields of the type Edm.DateTime will always be shown in this format if you select JSON. The format shows the number of seconds since January 1st, 1970 UTC.

You can change the format back to xml if you leave out the operand $format=json in your OData query.

Keywords

report, business analytics, data source, date, date time, date-time, edm.datetime, odata , KBA , AP-RC-ANA , C4C, ByD, Travel: Analytics Tools & Frameworks , Problem

Product

SAP Business ByDesign all versions ; SAP Cloud for Customer add-ins all versions ; SAP Cloud for Customer core applications all versions