4D Internet Commands v16

NET_Time

Home

 
4D Internet Commands v16
NET_Time

NET_Time 


 

NET_Time ( hostName ; Datum ; Zeit ; offset ) -> Funktionsergebnis 
Parameter Typ   Beschreibung
hostName  String in Host name or IP address
Datum  Datum in Date
Zeit  Lange Ganzzahl in Time, expressed as seconds since midnight
offset  Ganzzahl in Hours to offset
Funktionsergebnis  Ganzzahl in Error Code

Given the host name or IP address to an Internet Time server, the NET_Time command will obtain the current date and time from the machine and apply any offset needed to convert to the user's local time.

Note: This command does not affect the computer's internal clock.

hostName is the host name or IP address of an Internet Time server.

date is a 4D Date returned, containing the resulting date after the offset has been applied.

time is a LongInt value returned, containing the resulting time after the offset has been applied. The value represents the seconds since midnight on date. See the example below for a method to convert this value to a 4D Time variable.

offset is the number of hours to add or subtract from the base time values. Internet Time Servers express their values in Universal Time (Greenwich Mean Time). Even if the time server is in your geographic region, it is likely that you will need to supply an offset value to compensate for the difference between your local time and Universal time.

The following example obtains the Universal Time from the Time server at "apple.com". The command then subtracts the seven hours specified as the Offset and returns the resulting Date and Time (Time is expressed as a Longint value, which can then be converted using 4D's Time string command, as below).

 C_DATE(vNetDate)
 C_LONGINT(vNetTime)
 C_TIME(vTime)
 C_LONGINT(vOffset)
 If(ERRCHECK("NET_Time";NET_Time("www.apple.com";vNetDate;vNetTime;-7)))
    vTime:=Time(Time string(vNetTime)) //Convert the LongInt time to a 4D Time
 End if

 
EIGENSCHAFTEN 

Produkt: 4D Internet Commands
Thema: IC Internet
Nummer: 88924

 
GESCHICHTE 

Erstellt: 4D Internet Commands 6.5

 
ARTIKELVERWENDUNG

4D Internet Commands ( 4D Internet Commands v16)