Time.From

This function retrieves a time value from the input provided. There is an option to specify a culture (e.g., "en-US"). If the input is empty, the function returns null. If the input is already a time ...

Syntax

Time.From(value as any, optional culture as nullable text) as nullable time

About

This function retrieves a time value from the input provided. There is an option to specify a culture (e.g., "en-US"). If the input is empty, the function returns null. If the input is already a time value, it will be returned as is. Various types can be converted to a time value: - `text`: Represents a time value in a textual format. For a detailed conversion, refer to the Time.FromText function. - `datetime`: Represents the time component of the input value. - `datetimezone`: Represents the time component of the local datetime equivalent of the input value. - `number`: Represents a time value equivalent to the number of fractional days expressed by the input value. An error is returned if the number is negative or greater than or equal to 1. - For any other type of input, an error will be returned.

Explanation

Example 1 Change the value 0.7575 to a time format. Usage: In Power Query M language, use the function MTime.From(0.7575) Output: The result will be #time(18, 10, 48) Example 2 Convert the date and time #datetime(1899, 12, 30, 06, 45, 12) into a time format. Usage: Utilize the Power Query M function Time.From(#datetime(1899, 12, 30, 06, 45, 12)) Output: The output will be #time(06, 45, 12)