I think I’m having a time zone adjustment issue on historical data so I’m trying to figure out where I need to adjust time zone to make my data display the correct time zone on my historic data points. I can provide code or even access to the system privately but I have to be careful with screenshots because it’s a live system.
This system is currently running 8.01 RC so this may be a bug that was fixed or it could just be that I’m doing something wrong.
I have a bunch of tags set up for Historic data collection.
On one screen I have an XY chart that displays historic tag data using the “Tag History” section of the dataSource binding. I have the Tag Path static bound with an Alias defined for each tag. I bind that alias to a series on my XY Chart. I used a pair of “Date Time Input” controls to bind the Start Date and the End Date for the Historical Time Range for my dataSource binding. I’m binding to the “props.value” property on the Date Time Input controls. It displays a chart properly but I’m not sure if the dateTime displayed on the X axis is in EST or GMT.
On another screen I have the same Date Time Input controls but a Table control instead of an XY Chart. That screen is using a Python script to display data points Ad Hoc.
Notes for the code. dtiStart and dtiEnd are the names of my Date Time Input controls. Data is collected on a 2 minute interval and they wanted to exclude the last data point.
paths = payload['path'] alias = payload['alias'] startTime = self.getSibling('CoordContDatePick').getChild('dtiStart').props.value endTime = self.getSibling('CoordContDatePick').getChild('dtiEnd').props.value tempDate = system.date.fromMillis(endTime) tempDate = system.date.addMinutes(tempDate, -2) endTime = system.date.toMillis(tempDate) dataSet = system.tag.queryTagHistory(paths=paths, columnNames=alias, startDate=startTime, endDate=endTime, aggregationMode='LastValue', intervalMinutes=2) self.props.data = dataSet
The issue we’re seeing is that the data for a given time on the chart is not lining up with the same date in the data that is displayed in the table. I suspect the issue is that one of the data sets is displaying its datestamp in GMT and others are displaying it in EST (local time for the Gateway). All I know is that I see dips on the chart that are not reflected in the data for the data table on the same time range.
My understanding is that “system.tag.queryTagHistory” returns the data with the timestamp for the gateway’s time zone. I understood charts to work the same way. I think that assumption is wrong because the data source is the same and the data doesn’t line up.