Duration.OfSeconds Method

Definition

Overloads

Name Description
OfSeconds(Int64, Int64)

Obtains a Duration representing a number of seconds and an adjustment in nanoseconds.

OfSeconds(Int64)

Obtains a Duration representing a number of seconds.

OfSeconds(Int64, Int64)

Obtains a Duration representing a number of seconds and an adjustment in nanoseconds.

[Android.Runtime.Register("ofSeconds", "(JJ)Ljava/time/Duration;", "", ApiSince=26)]
public static Java.Time.Duration? OfSeconds(long seconds, long nanoAdjustment);
[<Android.Runtime.Register("ofSeconds", "(JJ)Ljava/time/Duration;", "", ApiSince=26)>]
static member OfSeconds : int64 * int64 -> Java.Time.Duration

Parameters

seconds
Int64

the number of seconds, positive or negative

nanoAdjustment
Int64

the nanosecond adjustment to the number of seconds, positive or negative

Returns

a Duration, not null

Attributes

Remarks

Obtains a Duration representing a number of seconds and an adjustment in nanoseconds. This method allows an arbitrary number of nanoseconds to be passed in. The factory will alter the values of the second and nanosecond in order to ensure that the stored nanosecond is in the range 0 to 999,999,999. For example, the following will result in exactly the same duration:

Java reference for java.time.Duration.ofSeconds.

Applies to

OfSeconds(Int64)

Obtains a Duration representing a number of seconds.

[Android.Runtime.Register("ofSeconds", "(J)Ljava/time/Duration;", "", ApiSince=26)]
public static Java.Time.Duration? OfSeconds(long seconds);
[<Android.Runtime.Register("ofSeconds", "(J)Ljava/time/Duration;", "", ApiSince=26)>]
static member OfSeconds : int64 -> Java.Time.Duration

Parameters

seconds
Int64

the number of seconds, positive or negative

Returns

a Duration, not null

Attributes

Remarks

Obtains a Duration representing a number of seconds. The nanosecond in second field is set to zero.

Java reference for java.time.Duration.ofSeconds.

Applies to