I have used below snippet to get previous event of tag with respect to current timestamp. It's returning timestamp which is almost 5 hours older than the last archived event's timestamp.
String expression = "PrevEvent('Sinusoid','*')";
List<AFTime> times = new List<AFTime>();
PIServer piserver = new PIServers().DefaultPIServer;
AFValues values = AFCalculation.CalculateAtTimes(piserver, expression, times);
foreach (AFValue Value in values)
Tried with CalculateATREeordedValues, CalculateATIntervals, but still not working. Did I miss anything?