Time.From

Time

Converts a value to a time.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

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

Parameters

NameTypeRequiredDescription
valueanyYesThe value to convert. Accepts text, datetime, datetimezone, and number values.
culturetextNoCulture code for locale-specific parsing (e.g., "en-US").

Return Value

timeA time value converted from the given input.

Remarks

Time.From converts text, datetime, datetimezone, or number values into a time. Text values are parsed according to standard time formats or the specified culture. Number values are interpreted as fractional days (e.g., 0.5 represents 12:00:00 PM). If the input is null, the function returns null.

Examples

Example 1: Extract time from OrderLog Timestamp

Table.AddColumn(
    Table.SelectColumns(
        Table.FirstN(OrderLog, 5),
        {"LogID", "Timestamp"}
    ),
    "TimeOnly", each Time.From([Timestamp]), type time
)
Result
LogID
Timestamp
TimeOnly
1L0011/15/2024 9:30:00 AM09:30:00
2L0021/16/2024 2:15:00 PM14:15:00
3L0031/18/2024 11:00:00 AM11:00:00
4L0041/20/2024 8:45:00 AM08:45:00
5L0052/1/2024 4:20:00 PM16:20:00

Example 2: Convert a text string to a time

#table(
    type table [Result = time],
    {{Time.From("14:30:00")}}
)
Result
Result
114:30:00

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks