DateTime.From

 

This topic applies to the Power Query Formula Language which can be used with Power Query and Power BI Desktop to build queries that mashup data. See the list of function categories.

Returns a datetime value from a value.

DateTime.From(value as any, optional culture as nullable text) as nullable datetime  

ArgumentDescription
valueValue to convert.
optional cultureA text value corresponding to the culture values supported on your version of Windows, such as "en-US". If the culture is not specified, the current user culture is used. For a list of culture names, see National Language Support (NLS) API Reference.

Type to convert

TypeDescription
textReturns a datetime value from a text value. For more details, see DateTime.FromText.
dateA datetime with value as the date component and 12:0:00 AM as the time component.
datetimezoneThe local date and time equivalent of value.
timeA datetime with the date equivalent to the OLE Automation Date of 0 as the date component and value as the time component.
numberA datetime equivalent the OLE Automation Date expressed by value.
any other typeAn Expression.Error is thrown.
  • If a value is null, DateTime.From returns null.

  • If a value is datetime, the same value is returned.

DateTime.From(#time(06, 45, 12)) equals #datetime(1899, 12, 30, 06, 45, 12)  

DateTime.From(#date(1975, 4, 4)) equals #datetime(1975, 4, 4, 0, 0, 0)  

Show: