Power Query
Search…
DateTime.ToText

DateTime.ToText

Returns a textual representation of the datetime value.
function (optional dateTime as nullable any, optional format as nullable any, optional culture as nullable any) as nullable any

Description

Returns a textual representation of dateTime, the datetime value, dateTime. This function takes in an optional format parameter format. For a complete list of supported formats, please refer to the Library specification document.

Category

DateTime

Examples

Get a textual representation of #datetime(2011, 12, 31, 11, 56, 2).
1
DateTime.ToText(#datetime(2010, 12, 31, 11, 56, 2))
Copied!
"12/31/2010 11:56:02 AM"
Get a textual representation of #datetime(2011, 12, 31, 11, 56, 2) with format option.
1
DateTime.ToText(#datetime(2010, 12, 31, 11, 56, 2), "yyyy/MM/ddThh:mm:ss")
Copied!
"2010/12/31T11:56:02"
Last modified 3yr ago