Time.FromText Function in Power Query
The Time.FromText function converts a time string (text) into a time value (time type in M). It can also use a specific culture setting to interpret the format of the input.
Syntax
Time.FromText(text as nullable text, optional options as any) as nullable time
The function has the following parameters:
- text: It is a mandatory parameter. A text string representing a time (like "14:30:00" or "02:30 PM")
- culture: It is an optional parameter. An optional culture code like "en-US" or "fr-FR" that affects how the time is interpreted (especially with AM/PM and separators)
Example:
Power Query M
let Source = Time.FromText("14:45:30") in Source
The output of the above code is 14:45:30.
Example:
Power Query M
let Source = Time.FromText("02:15 PM") in Source
The output of the above code is 14:15:00.