Wrong Timestamp when writing value to AF

Discussion created by rzandvliet on May 15, 2012
Latest reply on May 17, 2012 by mhalhead

I have defined an AF Attribute of the type string that is not connected to a datasource. I'm able to write a value (including timestamp) to the attribute, but when I look at the PI Explorer or I read the data of the attribute the timestamp contains 1/1/1970  12:00 AM instead of timestamp that was specified. Is this normal behaviour or do I something wrong?


Below you can find the code that I used to write a value to AF.



            OSIsoft.AF.Asset.AFValue val = new OSIsoft.AF.Asset.AFValue();

            val.Value = value;
            val.Timestamp = new OSIsoft.AF.Time.AFTime(DateTime.Now);
            val.IsGood = true;