Indy 9
TIdTimeUDP
Hierarchy, Properties, Methods, Events, See Also, Unit: IdTimeUDP
Implements a Time client.
TIdTimeUDP = class(TIdUDPClient)
Unit
IdTimeUDP
Description
TIdTime is a client implementation of the UDP version of the Time Protocol as described in the Internet Standards document:

  • RFC 868 - Time Protocol (http://www.rfc-editor.org/rfc/rfc868.txt)

Time is a simple protocol for synchronizing time on a local network. For a time protocol with higher accuracy over several networks, use TIdSNTP. To retrieve the current date and time in human-readable form, use TIdDayTime.

Please note that the Time Protocol in its current form cannot handle most dates after the year 2035. This limitation is stated in RFC 868.


TIdTimeUDP.BaseDate
TIdTimeUDP
Initial Date used for time server calculations.
property BaseDate: TDateTime;
Description
BaseDate is a TDateTime property that indicates the initial date used for Time server calculations. When the BaseDate for the client and server are identical, and exceeds the value of DateTime, DateTime can contain values beyond the year 2035.

Do not change BaseDate unless the Time server uses the same value for it's BaseDate.


TIdTimeUDP.DateTime
TIdTimeUDP
Current date and time from the server.
property DateTime: TDateTime;
Description
DateTime is a read-only TDateTime property that reflects the estimated current date and time according to a Time server. DateTime is expressed in the time zone for the local computer.

DateTime will contain the value 0.0 (for 12/30/1899 12:00 am) when no date and time values have been assigned.

The Host and Port properties must contain a valid Time server address and port assignment prior to accessing the value of DateTime.


TIdTimeUDP.DateTimeCard
TIdTimeUDP
Number of seconds since the base Time server date.
property DateTimeCard: Cardinal;
Description
DateTimeCard is a read-only Cardinal property that represents the number of seconds since 1/1/1900 12:00am.

The Host and Port properties must contain a valid Time server address and port assignment prior to accessing the value of DateTimeCard. DateTimeCard will query the time server and retrieve the property value.


TIdTimeUDP.Port
TIdTimeUDP, See Also
Port number for the Time protocol.
property Port: Integer;
Description
Port is an Integer property that represents the port number used by the Time protocol. Port is redefined in TIdTimeUDP to establish the default port number for the protocol (IdPORT_TIME).

TIdTimeUDP.RoundTripDelay
TIdTimeUDP, See Also
Estimated latency value.
property RoundTripDelay: Cardinal;
Description
RoundTripDelay is a read-only Cardinal property that indicates the estimated number of milliseconds required to receive data from the server. RoundTripDelay is used to adjust the calculated DateTime property.

TIdTimeUDP.Create
TIdTimeUDP, See Also
Constructor for the object instance.
constructor Create(AOwner: TComponent); override;
Description
Create is the constructor for the object instance. Create sets the default port to the standard port number used for the Time protocol (IdPORT_TIME), and sets BaseDate to Jan 1, 1900 as specified by the Time protocol.

TIdTimeUDP.SyncTime
TIdTimeUDP
Updates local time to match the Time server.
function SyncTime: Boolean;
Return Value
Boolean - True when local time has been updated.
Description
SyncTime is a Boolean function used to synchronize the local system clock with the Time server. When the value from the server is not empty, the local system clock will be updated.

Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.