DateTime.FromFileTime

DateTime.FromFileTime is a Power Query M function that creates a datetime value from the fileTime value and converts it to the local time zone.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

DateTime.FromFileTime( fileTime as nullable number ) as nullable datetime

Description

Creates a datetime value from the fileTime value and converts it to the local time zone. The filetime is a Windows file time value that represents the number of 100-nanosecond intervals that have elapsed since 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC).

Examples

Convert 129876402529842245 into a datetime value.

// Output: #datetime( 2012, 7, 24, 14, 50, 52.9842245 )
DateTime.FromFileTime( 129876402529842245 )

Other functions related to DateTime.FromFileTime are:

BI Gorilla Youtube Channel

Last update: August 25, 2023 | Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/datetime-fromfiletime
© 2023 BI Gorilla. All rights reserved. Content derived from Microsoft documentation is property of Microsoft Corp.