次の方法で共有


GregorianCalendar.From(ZonedDateTime) Method

Definition

Obtains an instance of GregorianCalendar with the default locale from a ZonedDateTime object.

[Android.Runtime.Register("from", "(Ljava/time/ZonedDateTime;)Ljava/util/GregorianCalendar;", "", ApiSince=26)]
public static Java.Util.GregorianCalendar? From (Java.Time.ZonedDateTime? zdt);
[<Android.Runtime.Register("from", "(Ljava/time/ZonedDateTime;)Ljava/util/GregorianCalendar;", "", ApiSince=26)>]
static member From : Java.Time.ZonedDateTime -> Java.Util.GregorianCalendar

Parameters

zdt
ZonedDateTime

the zoned date-time object to convert

Returns

the gregorian calendar representing the same point on the time-line as the zoned date-time provided

Attributes

Remarks

Obtains an instance of GregorianCalendar with the default locale from a ZonedDateTime object.

Since ZonedDateTime does not support a Julian-Gregorian cutover date and uses ISO calendar system, the return GregorianCalendar is a pure Gregorian calendar and uses ISO 8601 standard for week definitions, which has MONDAY as the Calendar#getFirstDayOfWeek() FirstDayOfWeek and 4 as the value of the Calendar#getMinimalDaysInFirstWeek() MinimalDaysInFirstWeek.

ZoneDateTime can store points on the time-line further in the future and further in the past than GregorianCalendar. In this scenario, this method will throw an IllegalArgumentException exception.

Added in 1.8.

Java documentation for java.util.GregorianCalendar.from(java.time.ZonedDateTime).

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