Time.From Function in Power Query
The Time.From function in Power Query returns a time value from the given value.
Syntax
Time.From(value as any, optional culture as nullable text) as nullable time
The function has the following parameter:
- value: The value you want to convert into a time. It can be a datetime, datetimezone, text, number, or time.
Purpose The Time.From function converts various types of values into a time value (datatype: Time). It works with:
- datetime: Returns the time component of the value.
- datetimezone
- text (with a recognizable time format)
- number (representing a fractional day)
- time (returns as-is)
Example: From datetime.
Power Query M
let Source = Time.From(#datetime(2025, 4, 10, 14, 30, 10)) in Source
The output of the above code is 14:30:10. Extracts just the time part from the datetime.
Example: From text.
Power Query M
let Source = Time.From("07:45:20") in Source
The output of the above code is 07:45:20. Converts a well-formatted text string into time so returned value is of Time datatype.