SAP Knowledge Base Article - Public

2439189 - Querying a date via API returns an incomprehensible value which does not looks like a date

Symptom

An integration tool is reading information from the database.

Querying fields that represent dates in the system, the application returns sequence of numbers and not the date that you will expect.

Environment

  • SuccessFactors
  • OData API

Reproducing the Issue

For example:

querying the Application Date in the Application table you get something like this:

 "applicationDate": "/Date(1487092163000+0000)/"

Cause

The system is using  the Unix Time (also known as POSIX Time or Epoch Time) and value it represents the number of seconds (in our case: the milliseconds) that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970.

You can read more information here: https://en.wikipedia.org/wiki/Unix_time

Resolution

If you need to convert that value you can use one of the tools available online, for example:

http://www.onlineconversion.com/unix_time.htm

Just remove the "000+0000" (we need to remove 000 because the full number represent the milliseconds and not the seconds) and convert it only to the value "1487092163", then you will get: Tue, 14 Feb 2017 17:09:23 GMT


temp.png

See Also

SAP SuccessFactors HCM Suite OData API: Developer Guide has more info about this date format and how it behaves on API calls (pages 34 and 35, topic 5.3 "Date and Time" and 5.3.1 "Using the DateTime Format").

Keywords

Date and Time, Unix time, POSIX time, Epoch Time, API, odata, format, utc, query, success, factors, successfactors , KBA , LOD-SF-RCM-API , Webservices & APIs , LOD-SF-INT-ODATA , OData API Framework , Problem

Product

SAP SuccessFactors HCM suite all versions