System.DateTimeOffset ConnectionTime { get; set; }

robot_2Generated
code_blocksInput

Description

The ConnectionTime property of the Connection class represents the exact date and time when the connection was established. This property is useful for tracking the duration of a connection or for logging purposes.

Usage

To access the ConnectionTime property, you need an instance of the Connection class. This property is read-only and returns a DateTimeOffset object, which includes both the date and time of the connection along with the offset from UTC.

Example

// Example of accessing the ConnectionTime property
Connection connection = Connection.Find(someGuid);
DateTimeOffset connectionTime = connection.ConnectionTime;

// Output the connection time
string formattedTime = connectionTime.ToString("yyyy-MM-dd HH:mm:ss zzz");
// Use the formattedTime string as needed, e.g., display it in a UI element