NetworkTimeTryGetNetworkTime Method |
Tries to get time from time.windows.com (or specified NTP server) and on failure returns local computer time.
Namespace:
TreeksLicensingLibrary2
Assembly:
TreeksLicensingLibrary2 (in TreeksLicensingLibrary2.dll) Version: 2.1.8318.42066 (2.1.0.0)
Syntax public static DateTime TryGetNetworkTime(
string NTPServer = "time.windows.com"
)
Public Shared Function TryGetNetworkTime (
Optional NTPServer As String = "time.windows.com"
) As DateTime
public:
static DateTime TryGetNetworkTime(
String^ NTPServer = L"time.windows.com"
)
static member TryGetNetworkTime :
?NTPServer : string
(* Defaults:
let _NTPServer = defaultArg NTPServer "time.windows.com"
*)
-> DateTime
Parameters
- NTPServer (Optional)
- Type: SystemString
String address of time server. By default time.windows.com
Return Value
Type:
DateTimeDateTime object with actual time
Remarks This function uses local computer time in offline state or connection errors.
See Also