ServerTime Method (Server object)

                    

 

Returns a PITime object representing the current time on the server to which the Server object is connected.

Syntax

object.ServerTime

The ServerTime method syntax has these parts:

Part Description
object An object expression that evaluates to a Server object.

Remarks

Returns a PITime object. This method obtains the server's time using a time offset between the server and client. The time offset is updated periodically. If the initial call does not succeed an error is returned. Otherwise, the cached time offset is used to determine the server time even if the server has become unavailable.

The cached time offset between the client and server is updated at two minute intervals. Since the time to retrieve the server time may vary due to varying network response, a weighted offset is used consisting of 20% of the new offset and 80% of the old offset. If the time elapsed between calling ServerTime is greater than 5 update intervals, the new offset is adopted without weighting.

Unlike PISDK data calls, ServerTime will not attempt to reconnect to the PI Server, but will return the estimate calculated with the cached time offset. A call to retrieve non-time information from the PI Server will attempt reconnection.

Trappable Errors

In addition to generic errors (such as Out of Memory), the following errors may occur:

Error Description
pseSERVERTIMEFETCH The initial server time call failed.
psePITIMECREATE Unable to create a PITime object.
Enabling Operational Intelligence