Share via


OffsetDateTime.ToEpochSecond Method

Definition

Converts this date-time to the number of seconds from the epoch of 1970-01-01T00:00:00Z.

[Android.Runtime.Register("toEpochSecond", "()J", "", ApiSince=26)]
public long ToEpochSecond ();
[<Android.Runtime.Register("toEpochSecond", "()J", "", ApiSince=26)>]
member this.ToEpochSecond : unit -> int64

Returns

the number of seconds from the epoch of 1970-01-01T00:00:00Z

Attributes

Remarks

Converts this date-time to the number of seconds from the epoch of 1970-01-01T00:00:00Z.

This allows this date-time to be converted to a value of the ChronoField#INSTANT_SECONDS epoch-seconds field. This is primarily intended for low-level conversions rather than general application usage.

Java documentation for java.time.OffsetDateTime.toEpochSecond().

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