DateTime.FromFileTime

Updated on

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

DateTime.FromFileTime creates a datetime value from the fileTime argument, converting it to the local time zone. fileTime is a Windows file time value representing the number of 100-nanosecond intervals since 12:00 midnight, January 1, 1601 A.D. (C.E.) 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:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/datetime-fromfiletime