I am writing a script (On a button) that will query the history tags using the “queryTagHistory” function. The dataset obtained from the query will be passed on a custom parameter on the button.
date = system.date.now()
dateMidnight = system.date.midnight(date)
startTime = system.date.addDays(dateMidnight, -8)
endTime = system.date.addHours(startTime, 24)
dataSet = system.tag.queryTagHistory(paths=['[SMYPC]Switch Gear/Substation/INCOMING FEEDER (-K101)/Energy Delivered'], startDate=startTime, endDate=endTime)
event.source.dataset = dataSet
print startTime
print endTime
The date range used on the code is:
Start Time: Tue Mar 30 00:00:00 SGT 2021
End Time: Wed Mar 31 00:00:00 SGT 2021
Upon checking the result of the dataset on the button’s custom property I got an extra data which is beyond the date:
I also used a power table to get the tag history with these settings:
Here is the binded date and time custom properties for the power table:
startdate: 03/30/2021 00:00:00 +0800
enddate: 03/31/2021 00:00:00 +0800
I also got the same results and got the same extra data I got on the script that I wrote on the button:
Is this a bug or am I doing something wrong?