02-05-2018 7:13 AM - edited 02-04-2024 3:54 AM
Hi,
when using the IoT Service on SAP NEO platform, the predefined "date" datatype does not allow for miliseconds. It only allows integer type timestamps.
How could we account for smaller time intervalls ?
Hello Marcus,
"date" type [1] in the IoT Service Neo could either a Unix time, represented as seconds since January 1, 1970 or represented as ISO 8601-compatible string. An example with milliseconds is "2016-01-14T08:01:02.123Z"
Regards,
Anton
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I guess this is just a matter of how HANA Cockpit represents the value. MMS Application Data (UI5) does the same, by the way:
If you consume it with MMS OData API, the the value is exactly what you are expecting for:
<entry>
<id>
https://iotmms***.hanatrial.ondemand.com:443/com.sap.iotservices.mms/v1/api/http/app.svc/T_IOT_M0T0Y0P0E1(G_DEVICE='d000-e000-v000-i000-c000-e001',G_CREATED=datetime'2018-02-07T14%3A00%3A41.231',C_SENSOR='sensor1',C_VALUE='21',C_TIMESTAMP=datetime'2019-05-11T12%3A59%3A04.999')
</id>
<title type="text">T_IOT_M0T0Y0P0E1</title>
<updated>2018-02-07T14:09:29.782Z</updated>
<category term="com.sap.iotservices.mms.entity0" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<link href="T_IOT_M0T0Y0P0E1(G_DEVICE='d000-e000-v000-i000-c000-e001',G_CREATED=datetime'2018-02-07T14%3A00%3A41.231',C_SENSOR='sensor1',C_VALUE='21',C_TIMESTAMP=datetime'2019-05-11T12%3A59%3A04.999')" rel="edit" title="entity0"/>
<content type="application/xml">
<m:properties>
<d:G_DEVICE>d000-e000-v000-i000-c000-e001</d:G_DEVICE>
<d:G_CREATED>2018-02-07T14:00:41.231</d:G_CREATED>
<d:C_SENSOR>sensor1</d:C_SENSOR>
<d:C_VALUE>21</d:C_VALUE>
<d:C_TIMESTAMP>2019-05-11T12:59:04.999</d:C_TIMESTAMP>
</m:properties>
</content>
</entry>
I consume it with a web service from a view in HANA to display in Analytics Cloud. However neither the data in the db nor the service data show the miliseconds. Also in the service test screen I cannot post the miliseconds. If I e.g. your format proposal, the HANA DB shows:
The message was
{"mode":"sync","messageType":"m0t0y0p0e1","messages":[{"sensor":"sensor1","value":"20","timestamp":"2019-05-11T12:59:04.999Z"}]}
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.