ok quick update, I did some testing and seem to have a better understanding, but it seems that our server and our customer's server are returning different results. Is there a setting somewhere that specifies whether the timestamps are returned in UTC vs Local?
Is the summaries function expecting datetime in local time or UTC?
The function should be expecting local time if you are passing in a datetime object. You can refer to a similar discussion here.
If its expecting time in local, how do you specify first vs second Hour Ending 2 on the long day?
I'm afraid I'm not sure how to answer this part of your question, because I am not very familiar on dealing with DST as well, lets see what others in the community has to suggest about this.
The timestamps that are returned, are they in UTC?
The timestamps associated with the returned result (in the form of NamedValues and PIValues collection) are PITime object where you can get either the local datetime or UTC from it.
Hope this helps
Han YongYou can read the timestamp from the PITime object through its LocalDate or UTCSeconds properties. LocalDate will return a standard .NET DateTime object, which has a variety of methods to deal time arithmetics and time zone (e.g. ToUniversalTime). The UTCSeconds property gives you the number of seconds elapsed since January 1st, 1970 UTC; you can use that number to initialize a standard .NET DateTime object.
The timestamps associated with the returned result are PITime object where you can get either the local datetime or UTC from it.
Hope this helps!
The input of any method can take a variety of input timestamps. The type of the input object determines how the PISDK method evaluates the timestamp. See the Summaries method help page which describes the input values that are legal.
For instance, a string will be parsed using PITimeFormat.InputString from the PITimeServer to parse the value. Strings are assumed to be local time and thus use the local system time zone to generate UTC (TAI - we call it UTC but leap seconds are not used) values. If the DateTime translates to a VT_DATE, it will be translated using the PITime.LocalDate method, also translated using the local time zone.
Any Integer or Double will translate into a UTC with no conversion.
Using a PITime, PITimeFormat, or DynamicTime is also legal, and these store UTC timestamp internally at the time any property is set. The one exception is DynamicTime, which will evaluate '*' when any timestamp is requested. This is useful for things like trends in which the current time is the end time.
All timestamps sent to the PI server are UTC timestamps. All timestamps retrieved from the PI server are UTC timestamps.
Most methods will return a PITime object which can hand out UTC seconds or LocalDate (based on local time zone). PITimeFormat may be used to set a time zone other than the local one and generate a LocalDate or OutputString based on the time zone setting.