AnsweredAssumed Answered

AFTime conversion when creating AFValue

Question asked by Jiahui07 on Feb 6, 2015
Latest reply on Feb 9, 2015 by Jiahui07

Hi,

I want to create a AFValue with value and timestamp obtained from a database.

Here is the basic code:

AFValue myValue;
while (myReader.Read())
{  
    myValue = new AFValue(Convert.ToSingle(myReader[tableColName]));   
    myValue.Timestamp = new AFTime(myReader["Sample_date"]);
    myPIPoint.UpdateValue(myValue, AFUpdateOption.Insert);
}

However, the timestamp is not consistant with the original timestamp value from the database.

I know this is a timezone problem, however I have not figured our a way to correct this.

Can you provide the exact code?

Thanks.

Outcomes