DateTimeOffset.ToUnixTimeMilliseconds 方法

定義

傳回自 1970-01-01T00:00:00.000Z 以來所經過的毫秒數。Returns the number of milliseconds that have elapsed since 1970-01-01T00:00:00.000Z.

public:
 long ToUnixTimeMilliseconds();
public long ToUnixTimeMilliseconds ();
member this.ToUnixTimeMilliseconds : unit -> int64
Public Function ToUnixTimeMilliseconds () As Long

傳回

Int64

自 1970-01-01T00:00:00.000Z 以來所經過的毫秒數。The number of milliseconds that have elapsed since 1970-01-01T00:00:00.000Z.

備註

Unix 時間代表自 1970-01-01T00:00: 00Z (1970 年1月1日上午12:00 點 UTC) 所經過的秒數。Unix time represents the number of seconds that have elapsed since 1970-01-01T00:00:00Z (January 1, 1970, at 12:00 AM UTC). 這並不需要閏秒的帳戶。It does not take leap seconds into account. 這個方法會傳回 Unix 時間的毫秒數。This method returns the number of milliseconds in Unix time.

這個方法會先將目前的實例轉換為 UTC,然後才傳回其 Unix 時間的毫秒數。This method first converts the current instance to UTC before returning the number of milliseconds in its Unix time. 若為 1970-01-01T00:00:00Z 之前的日期和時間值,這個方法會傳回負數值。For date and time values before 1970-01-01T00:00:00Z, this method returns a negative value.

適用於

另請參閱