Partager via


Time.Normalize(Boolean) Method

Definition

Ensures the values in each field are in range.

[Android.Runtime.Register("normalize", "(Z)J", "GetNormalize_ZHandler")]
public virtual long Normalize (bool ignoreDst);
[<Android.Runtime.Register("normalize", "(Z)J", "GetNormalize_ZHandler")>]
abstract member Normalize : bool -> int64
override this.Normalize : bool -> int64

Parameters

ignoreDst
Boolean

Returns

the UTC milliseconds since the epoch, or -1

Attributes

Remarks

Ensures the values in each field are in range. For example if the current value of this calendar is March 32, normalize() will convert it to April 1. It also fills in weekDay, yearDay, isDst and gmtoff.

If "ignoreDst" is true, then this method sets the "isDst" field to -1 (the "unknown" value) before normalizing. It then computes the time in milliseconds and sets the correct value for "isDst" if the fields resolve to a valid date / time.

See #toMillis(boolean) for more information about when to use true or false for "ignoreDst" and when -1 might be returned.

Java documentation for android.text.format.Time.normalize(boolean).

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