Share via


Instant.ToEpochMilli Method

Definition

Converts this instant to the number of milliseconds from the epoch of 1970-01-01T00:00:00Z.

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

Returns

the number of milliseconds since the epoch of 1970-01-01T00:00:00Z

Attributes

Remarks

Converts this instant to the number of milliseconds from the epoch of 1970-01-01T00:00:00Z.

If this instant represents a point on the time-line too far in the future or past to fit in a long milliseconds, then an exception is thrown.

If this instant has greater than millisecond precision, then the conversion will drop any excess precision information as though the amount in nanoseconds was subject to integer division by one million.

Java documentation for java.time.Instant.toEpochMilli().

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