cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

How to get Data from stream based on date

odarde
1-Newbie

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 5
PaiChung
22-Sapphire I
(To:odarde)

QueryStreamEntriesWithData allows you to put in a date time range.

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?

PaiChung
22-Sapphire I
(To:odarde)

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.

Hi Pai Chung,

We have tried but could not get the expected  one day data irrespective of time stamp

objective is

1) Get complete data of the particular date

2) Can be used single date parameter(if this is possible what snippet available) or range ( start date and end date), if range is used stating date time stamp should be set with 00:00:00 and end date time stamp should be set with 11:59:00 like this

It would be very helpful if could you send sample code which needs to be written in service.

Thanks in advance

Regards,

Anil Kesana

PaiChung
22-Sapphire I
(To:akesana)

This is an older link but go to Help/Documentation and search for Query Parameter

Digital Media Publisher

So you can retrieve using querystreamentrieswithdata and pass that query in against the timestamp

Top Tags