0

Our edge device has an inbuilt data logging function which logs data at regular intervals. If for some reason a connection to the cloud is lost for a period of time, then the next time it connects it will upload data from it's internal data log memory. In this case the sample is sent with a time stamp of when the data was logged, which is obviously different to the time it is received by the cloud.

The time stamp is sent in a standard format as shown by the packet below.

{"d": { "Ch_1": 37.4,"Ch_2": 37.1,"Ch_3": 3276.7,"Ch_4": 3276.7},"bt": "2016-09-19T14:35:00.00+12:00"}

where "bt" is name for the base time of the sample. Looking at the property details in the schemas, I can set the data type to a string type but how would I get this data to be recognized as a date/time stamp and store this data accordingly?

Is there a way of doing this?

amadain
  • 2,724
  • 4
  • 37
  • 58
Roy
  • 1
  • There are any number of ways to convert a json string to a date, really depends on the language - see for example with javascript http://stackoverflow.com/questions/1244094/converting-json-results-to-a-date. But I feel I'm missing something in this question, like what language and where you are storing the data (this schema?). It might be obvious to someone what you mean but isn't to me! – amadain Oct 03 '16 at 13:20
  • Sorry, some more info. So say I use the rules engine to create some rules for incoming data and then I create a Board in the IoT platform which contains some real time graphs. My problem is that when bulk data is received with embedded time stamps all the data appears in one point on the graph (at the time it was received). How can I specify in the rules engine that actually, this data contains specific time stamps so that the real time graph will display the data correctly? – Roy Oct 03 '16 at 22:27
  • What is the context of the question? Any specifc service (IoT, node-red, any database, ...)? Any specific programming language/environment? That should be mentioned and tags added. – data_henrik Oct 04 '16 at 06:06
  • The terminology is from the watson iot platform. I think I understand now but I don't know the best solution, needs some thinking. Or maybe someone else knows. I'll see if I can add tags. – amadain Oct 04 '16 at 10:06
  • My apologies again. I'm new to stack overflow :-) Yes this is issue relates to Watson IoT platform. – Roy Oct 04 '16 at 20:28

0 Answers0