DateTime.FromFileTimeUtc(Int64) 方法

定義

將指定的 Windows 檔案時間轉換成相等的 UTC 時間。Converts the specified Windows file time to an equivalent UTC time.

public:
 static DateTime FromFileTimeUtc(long fileTime);
public static DateTime FromFileTimeUtc (long fileTime);
static member FromFileTimeUtc : int64 -> DateTime
Public Shared Function FromFileTimeUtc (fileTime As Long) As DateTime

參數

fileTime
Int64

Windows 檔案時間以刻度表示。A Windows file time expressed in ticks.

傳回

物件,表示 fileTime 參數所表示日期和時間的 UTC 時間對應項。An object that represents the UTC time equivalent of the date and time represented by the fileTime parameter.

例外狀況

fileTime 小於 0 或代表大於 MaxValue 的時間。fileTime is less than 0 or represents a time greater than MaxValue.

備註

Windows 檔案時間是64位的值,代表自西元1601年1月1日午夜起經過12:00 的 100-毫微秒間隔數A Windows file time is a 64-bit value that represents the number of 100-nanosecond intervals that have elapsed since 12:00 midnight, January 1, 1601 A.D. 國際標準時間(UTC)(C.E.) Coordinated Universal Time (UTC). 當應用程式建立、存取或寫入檔案時,Windows 會使用檔案時間來記錄。Windows uses a file time to record when an application creates, accesses, or writes to a file.

fileTime 參數會指定以 100-毫微秒刻度表示的檔案時間。The fileTime parameter specifies a file time expressed in 100-nanosecond ticks.

從 .NET Framework 版本2.0 開始,傳回值是 UtcKind 屬性的 DateTimeStarting with the .NET Framework version 2.0, the return value is a DateTime whose Kind property is Utc.

適用於

另請參閱