TimeZoneSettings.AutoUpdateTimeZoneAsync(TimeSpan) TimeZoneSettings.AutoUpdateTimeZoneAsync(TimeSpan) TimeZoneSettings.AutoUpdateTimeZoneAsync(TimeSpan) TimeZoneSettings.AutoUpdateTimeZoneAsync(TimeSpan) TimeZoneSettings.AutoUpdateTimeZoneAsync(TimeSpan) Method

Definition

Attempts to automatically determine and set the time zone for embedded mode devices.

public : static IAsyncOperation<AutoUpdateTimeZoneStatus> AutoUpdateTimeZoneAsync(TimeSpan timeout)
static IAsyncOperation<AutoUpdateTimeZoneStatus> AutoUpdateTimeZoneAsync(TimeSpan timeout) const;
public static IAsyncOperation<AutoUpdateTimeZoneStatus> AutoUpdateTimeZoneAsync(TimeSpan timeout)
Public Shared Function AutoUpdateTimeZoneAsync(timeout As TimeSpan) As IAsyncOperation(Of AutoUpdateTimeZoneStatus)
Windows.System.TimeZoneSettings.autoUpdateTimeZoneAsync(timeout).done( /* Your success and error handlers */ );

Parameters

timeout
TimeSpan TimeSpan TimeSpan

If the time-out period is exceeded, this method returns a value of TimedOut for the AutoUpdateTimeZoneStatus.

The recommended time-out value is 60 seconds.

Returns

Additional features and requirements

Device family
Windows 10, version 1809 (introduced v10.0.17763.0)
API contract
Windows.System.SystemManagementContract (introduced v6)

Remarks

You can run this method at start up to set the time zone without prompting users for information.

This method does not necessarily change the time zone or find the correct time zone. For the results of the attempt, see the AutoUpdateTimeZoneStatus enumeration.

Separately, you can include a way for the user to set the time zone at a later time.

This method can use information from any of the following sources to determine the time zone:

  • GPS
  • Cellular
  • Wi-Fi
  • IP Address

If your device does not have access to any method of determining location, you should not run this method.

See also