AFTimeRange  4 hours off.

Discussion created by loiselle on May 10, 2013
Latest reply on Jul 8, 2013 by jeffjamesmcmahon

Hi All,


We have an intermittent issue problem using the AFSDK  AFTimeRange object.


public HistorySet GetValues(string internalName, DateTime startTime, DateTime endTime, TimeSpan interval)
            int count = 0;
            var historySet = new HistorySet();
            OSIsoft.AF.PI.PIPoint PiPoint = null;
            AFValues afValues = null;

            // Set the Time Range
            AFTimeRange timeRange = new AFTimeRange();
            timeRange.StartTime = new AFTime(startTime);
            timeRange.EndTime = new AFTime(endTime);
            //timeRange.StartTime = new AFTime(startTime.ToString());
            //timeRange.EndTime = new AFTime(endTime.ToString());
break here.....


Our startTime and endTime are correct when entering the method,  but by the time we initialize our timeRange object we find the the starttime property of the timeRage off by 4 hours.


This is an intermittent issue and causing problems at a customer site.


We guess maybe it may have to do with the AFTIME constructor. any body else plagued with this problem???


Please advise: