Language

OffsetDateTime.Of Method

Definition

Overloads

Name Description
Of(LocalDate, LocalTime, ZoneOffset)

Obtains an instance of OffsetDateTime from a date, time and offset.

Of(Int32, Int32, Int32, Int32, Int32, Int32, Int32, ZoneOffset)

Obtains an instance of OffsetDateTime from a year, month, day, hour, minute, second, nanosecond and offset.

Of(LocalDateTime, ZoneOffset)

Obtains an instance of OffsetDateTime from a date-time and offset.

Of(LocalDate, LocalTime, ZoneOffset)

Obtains an instance of OffsetDateTime from a date, time and offset.

[Android.Runtime.Register("of", "(Ljava/time/LocalDate;Ljava/time/LocalTime;Ljava/time/ZoneOffset;)Ljava/time/OffsetDateTime;", "", ApiSince=26)]
public static Java.Time.OffsetDateTime? Of(Java.Time.LocalDate? date, Java.Time.LocalTime? time, Java.Time.ZoneOffset? offset);
[<Android.Runtime.Register("of", "(Ljava/time/LocalDate;Ljava/time/LocalTime;Ljava/time/ZoneOffset;)Ljava/time/OffsetDateTime;", "", ApiSince=26)>]
static member Of : Java.Time.LocalDate * Java.Time.LocalTime * Java.Time.ZoneOffset -> Java.Time.OffsetDateTime

Parameters

date
LocalDate

the local date, not null

time
LocalTime

the local time, not null

offset
ZoneOffset

the zone offset, not null

Returns

the offset date-time, not null

Attributes

Remarks

Obtains an instance of OffsetDateTime from a date, time and offset. This creates an offset date-time with the specified local date, time and offset.

Java reference for java.time.OffsetDateTime.of.

Applies to

Of(Int32, Int32, Int32, Int32, Int32, Int32, Int32, ZoneOffset)

Obtains an instance of OffsetDateTime from a year, month, day, hour, minute, second, nanosecond and offset.

[Android.Runtime.Register("of", "(IIIIIIILjava/time/ZoneOffset;)Ljava/time/OffsetDateTime;", "", ApiSince=26)]
public static Java.Time.OffsetDateTime? Of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, Java.Time.ZoneOffset? offset);
[<Android.Runtime.Register("of", "(IIIIIIILjava/time/ZoneOffset;)Ljava/time/OffsetDateTime;", "", ApiSince=26)>]
static member Of : int * int * int * int * int * int * int * Java.Time.ZoneOffset -> Java.Time.OffsetDateTime

Parameters

year
Int32

the year to represent, from MIN_YEAR to MAX_YEAR

month
Int32

the month-of-year to represent, from 1 (January) to 12 (December)

dayOfMonth
Int32

the day-of-month to represent, from 1 to 31

hour
Int32

the hour-of-day to represent, from 0 to 23

minute
Int32

the minute-of-hour to represent, from 0 to 59

second
Int32

the second-of-minute to represent, from 0 to 59

nanoOfSecond
Int32

the nano-of-second to represent, from 0 to 999,999,999

offset
ZoneOffset

the zone offset, not null

Returns

the offset date-time, not null

Attributes

Remarks

Obtains an instance of OffsetDateTime from a year, month, day, hour, minute, second, nanosecond and offset. This creates an offset date-time with the seven specified fields. This method exists primarily for writing test cases. Non test-code will typically use other methods to create an offset time. LocalDateTime has five additional convenience variants of the equivalent factory method taking fewer arguments. They are not provided here to reduce the footprint of the API.

Java reference for java.time.OffsetDateTime.of.

Applies to

Of(LocalDateTime, ZoneOffset)

Obtains an instance of OffsetDateTime from a date-time and offset.

[Android.Runtime.Register("of", "(Ljava/time/LocalDateTime;Ljava/time/ZoneOffset;)Ljava/time/OffsetDateTime;", "", ApiSince=26)]
public static Java.Time.OffsetDateTime? Of(Java.Time.LocalDateTime? dateTime, Java.Time.ZoneOffset? offset);
[<Android.Runtime.Register("of", "(Ljava/time/LocalDateTime;Ljava/time/ZoneOffset;)Ljava/time/OffsetDateTime;", "", ApiSince=26)>]
static member Of : Java.Time.LocalDateTime * Java.Time.ZoneOffset -> Java.Time.OffsetDateTime

Parameters

dateTime
LocalDateTime

the local date-time, not null

offset
ZoneOffset

the zone offset, not null

Returns

the offset date-time, not null

Attributes

Remarks

Obtains an instance of OffsetDateTime from a date-time and offset. This creates an offset date-time with the specified local date-time and offset.

Java reference for java.time.OffsetDateTime.of.

Applies to