Clock.SystemDefaultZone Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Obtains a clock that returns the current instant using the best available system clock, converting to date and time using the default time-zone.
[Android.Runtime.Register("systemDefaultZone", "()Ljava/time/Clock;", "", ApiSince=26)]
public static Java.Time.Clock? SystemDefaultZone();
[<Android.Runtime.Register("systemDefaultZone", "()Ljava/time/Clock;", "", ApiSince=26)>]
static member SystemDefaultZone : unit -> Java.Time.Clock
Returns
a clock that uses the best available system clock in the default zone, not null
- Attributes
Remarks
Obtains a clock that returns the current instant using the best available system clock, converting to date and time using the default time-zone. This clock is based on the best available system clock. This may use System.currentTimeMillis(), or a higher resolution clock if one is available. Using this method hard codes a dependency to the default time-zone into your application. It is recommended to avoid this and use a specific time-zone whenever possible. The UTC clock should be used when you need the current instant without the date or time. The returned implementation is immutable, thread-safe and Serializable. It is equivalent to system(ZoneId.systemDefault()).
Java reference for java.time.Clock.systemDefaultZone.