Should these be equivalent print statements and if not why not?
print(pointsList[k].runtime.prev(HOUR, 1).sum); print(pointsList[k].runtime.prev(MINUTE, 60).sum);
phildunlap last edited by
No, they are not equivalent. As described in the documentation, https://help.infiniteautomation.com/about-mango-java-script/ (and in the context help blue (?) for the script), the previous function aligns the period boundaries based on the period type and not by both the period type and the number of periods. So, if you ran those at 1:15:23 PM, the first would get data from 12:00PM(inclusive) to 1:00PM(exclusive) where the second would be over 12:15-1:15PM
Sorry I should have qualified that question. I meant if they were run exactly on the hour would they be equivalent?