SystemClock.CurrentNetworkTimeClock Method

Definition

Returns a Clock that starts at January 1, 1970 00:00:00.

[Android.Runtime.Register("currentNetworkTimeClock", "()Ljava/time/Clock;", "", ApiSince=33)]
public static Java.Time.Clock CurrentNetworkTimeClock ();
[<Android.Runtime.Register("currentNetworkTimeClock", "()Ljava/time/Clock;", "", ApiSince=33)>]
static member CurrentNetworkTimeClock : unit -> Java.Time.Clock

Returns

Attributes

Remarks

Returns a Clock that starts at January 1, 1970 00:00:00.0 UTC, synchronized using a remote network source outside the device.

While the time returned by System#currentTimeMillis() can be adjusted by the user, the time returned by this method cannot be adjusted by the user.

This performs no blocking network operations and returns values based on a recent successful synchronization event; it will either return a valid time or throw.

Note that synchronization may occur using an insecure network protocol, so the returned time should not be used for security purposes. The device may resynchronize with the same or different network source at any time. Due to network delays, variations between servers, or local (client side) clock drift, the accuracy of the returned times cannot be guaranteed. In extreme cases, consecutive calls to Clock#millis() on the returned Clockcould return times that are out of order.

Java documentation for android.os.SystemClock.currentNetworkTimeClock().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to