I am trying to come up with a report that will query flow statistics for several sites across a user entered date range. So far, my script seems to work fine for nearly all cases:
[code]from java.util import Calendar
startCal = Calendar.getInstance()
#startCal.set(2013,10,01,0,0,0)
startCal.set(2013,9,01,0,0,0)
stopCal = Calendar.getInstance()
#stopCal.set(2013,11,01,00,00,00)
stopCal.set(2013,10,01,0,0,0)
tags = ["[history]path/to/tag"]
returnSet = system.tag.queryTagHistory(paths=tags, startDate=startCal.getTime(),endDate=stopCal.getTime(),aggregationMode=“Average”,returnFormat=“Wide”,intervalHours=24)
print returnSet
for row in range(0,returnSet.rowCount):
print str(returnSet.getValueAt(row,0)) + " " + str(returnSet.getValueAt(row,1))[/code]
The script above is set to run from October 1 of this year to November 1. It runs and returns the average values with timestamps that I would have predicted: midnight of each day in October and the first day of November.
Once I query across the leap year boundary (the commented out dates), everything goes awry. The timestamps returned are about 45 minutes short of a full 24 hours. They start at 11/1/2013 00:00:00, next is 11/1/2013 23:15:29, then 11/2/2013 22:30:58, etc.
What I really want to do is get the average flow for each calendar day. Specifying an intervalHours of 24 seems to work except across daylight savings boundaries. Is there a way to do this that I have missed?
Edit: I am running Ignition version 7.5.10