Skip to main content
1-Visitor
June 12, 2017
Question

How to get Data from stream based on date

Hi,

We have a stream and we want to retrieve data from stream based on specific date(excluding time stamp means particular full day data).

We have tried but it asks date with time stamp but we want date wise data(2017-06-09 00:00:00  to 2017-06-09 23:59:00) only whatever may be the time.

Could you please help us to resolve the issue.

Thanks,

Omkar

5 replies

22-Sapphire I
June 12, 2017

QueryStreamEntriesWithData allows you to put in a date time range.

Translate
odarde1-VisitorAuthor
1-Visitor
June 12, 2017

Hi Pai,

Thanks for your quick response, We have seen that service where we have to pass start date and end date with time stamp.

But when we use input parameter we have only datetime(base type), how to set time stamp range of start date to 2017-06-09 00:00:00


end date to 2017-06-09 23:59:00 ​?



Could you please explain a bit more?

Translate
22-Sapphire I
June 12, 2017

You should be able to use something like: var d = new Date(year, month, day, hours, minutes, seconds, milliseconds);

Do remember that Thingworx stores miliseconds from epoch / UST 0 and if  it is receiving date time with timestamps it will account for the specified offset.

Translate