Time.ToText Function in Power Query
The Time.ToText function in Power Query returns a text value from a Time value.
Syntax
Time.ToText( time as nullable time, optional options as any, optional culture as nullable text ) as nullable text
The function has the following parameters:
- time: The time value you want to convert (type: time).
- format: It is an optional parameter. A string that defines how the time should be formatted (e.g., "hh:mm tt").
- culture: It is an optional parameter. The culture info to use for formatting (e.g., "en-US").
Example:
Power Query M
let Source = Time.ToText(#time(20, 54, 25)) in Source
The output of the above code is 20:54.
Example:
Power Query M
let Source = Time.ToText(#time(14, 30, 10), "hh:mm tt") // Returns "02:30 PM" in Source
The output of the above code is 02:30 PM.