DateTime.FromFileTimeUtc(Int64) DateTime.FromFileTimeUtc(Int64) DateTime.FromFileTimeUtc(Int64) DateTime.FromFileTimeUtc(Int64) Method

定义

将指定的 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 Int64 Int64 Int64

以计时周期表示的 Windows 文件时间。A Windows file time expressed in ticks.

返回

一个表示 UTC 时间的对象,等效于由 fileTime 参数表示的日期和时间。An object that represents the UTC time equivalent of the date and time represented by the fileTime parameter.

异常

fileTime 小于零或表示大于 MaxValue 的时间。fileTime is less than 0 or represents a time greater than MaxValue.

注解

Windows 文件时间是一个64位的值, 它表示自公元1900年1月 1601 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 开始, 返回值为DateTime , 其Kind属性为UtcStarting with the .NET Framework version 2.0, the return value is a DateTime whose Kind property is Utc.

适用于

另请参阅