Copyright: Copyright (c)1997-1998 NetMasters LLC


TNMDayTime component

Heirarchy	Properties	Methods	Events	Tasks

Description

The TNMDayTime component is used for getting the date and time from Internet daytime servers, as described in RFC 867.


TNMDayTime - Properties
TNMDayTime Properties

TNMDayTIme

Legend

In TNMDayTime

  	DayTimeStr

Derived from TPowersock

         About

   	   	BeenCanceled

   	    	BeenTimedOut

       	BytesRecvd

   	    	BytesSent

       	BytesTotal

   Connected

    	Handle

 	Host

   	LastErrorNo

    	LocalIP

 	Port

   	Proxy

   	ProxyPort

    	RemoteIP

    	ReplyNumber

   	ReportLevel

   Status

   	TimeOut

    	TransactionReply

    	WSAInfo

Derived from TComponent

     	ComObject

     	ComponentCount

ComponentIndex

     	Components

     	ComponentState

     	ComponentStyle

DesignInfo

     	Owner

   	Tag

VCLComObject


TNMDayTime - Methods
TNMDayTime Methods

TNMDayTime

Legend

Derived from TPowersock

Abort

Accept

Cancel

CaptureFile

CaptureStream

CaptureString

CertifyConnect

Connect

Create

Destroy

Disconnect

FilterHeader

GetLocalAddress

GetPortstring

Listen

read

ReadLn

RequestCloseSocket

SendBuffer

SendFile

SendStream

Transaction

write

writeln

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

FreeOnRelease

GetParentComponent

HasParent

InsertComponent

RemoveComponent

SafeCallException

Derived from TPersistent

Assign

GetNamePath

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

GetInterface

GetInterfaceEntry

GetInterfaceTable

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TNMDayTime - Events
TNMDayTime Events

TNMDayTime

Legend

Derived from TPowersock

         OnAccept

OnConnect

OnConnectionFailed

         OnConnectionRequired

OnDisconnect

         OnError

OnHostResolved

OnInvalidHost

OnPacketRecvd

OnPacketSent

OnRead

OnStatus


About the TNMDayTime component

TNMDayTime reference

Purpose

The purpose of the TNMDayTime component is to get the date and time from an internet/intranet daytime server. This component requires a 32 bit TCP/IP stack, WSOCK32.DLL, which can be obtained from many vendors, and is included with Windows 95.

Tasks

Before you can get the date and time from an internet daytime server, you must first know the host name or dotted IP address of the daytime host, and assign that value to the Host property.

Once the host is set, just read the value in the DayTimeStr property, and that will give you the date and time from the specified host.


DayTimeStr property

See also	Example

Declaration

property DayTimeStr: string;

Description

The DayTimeStr property contains the date and time retrieved from the remote host.

Scope: Public

Accessibility: RunTime, ReadOnly

Prerequisites:

The Host property must be set to a valid internet daytime server.

Notes:

The format of the date and time will vary depending on the server queried.

Warnings:

Calling the inherited connect method will cause the connection to fail.


DayTimeStr property - See also
See also

Host property


DayTimeStr property - Example
Example

To recreate this example, you will need to create a new Delphi application.

Drop a TButton, a TLabel, and a TNMDayTime1 on the form.

Place the following code into Button1's OnClick event.

procedure TForm1.Button1Click(Sender: TObject);

begin

  NMDayTime1.ReportLevel := Status_Basic;

  NMDayTime1.TimeOut := 5000;

  NMDayTime1.Host := 'www.netmastersllc.com';

  Label1.Caption := NMDayTime1.DayTimeStr;

end;

In this example, the ReportLevel property is set to Status_Basic, for basic status reporting. The TimeOut property is set for 5 seconds (5000 milliseconds). The Host property is set to 'www.netmastersllc.com', which has a DayTime server running. Finally, Label1's caption is set to the current date and time by reading the DayTimeStr property, which returns the date and time in a format determined by the server.


Legend

 Run-time only

 Read-Only

 Published

 Protected

 Key item


TNMDayTime Heirarchy
Heirarchy

TObject

      |

TPersistent

      |

TComponent

      |

TPowersock