Time.From
Converts a value, such as a datetime or text, to a time of day.
Time.From(value as any, optional culture as nullable text) as nullable timeReturns: The time of day, or null when the input is null.
What it does
Time.From turns a value into a time of day. It is the general conversion, the way Date.From and DateTime.From are for dates. Use it when a column holds a time as a datetime or as text, and the report needs only the clock time. For a datetime you already have, DateTime.Time does the same job more directly.
Syntax and arguments
- value: a datetime, a time, or text that holds a time.
- culture (optional): the culture used to read text, such as "en-US".
Example
A payroll file records the clock-out time of each shift as a datetime. The payroll team wants the clock-out time on its own, and checks whether it falls after a set hour to apply the late shift rate.
let
Shifts = #table(type table [Employee = text, ClockOut = datetime],
{{"E-14", #datetime(2026, 10, 29, 17, 5, 0)}, {"E-22", #datetime(2026, 10, 29, 22, 40, 0)}}),
Times = Table.AddColumn(Shifts, "ClockOutTime", each Time.From([ClockOut]), type time),
LateRate = Table.AddColumn(Times, "LateShift", each [ClockOutTime] >= #time(22, 0, 0), type logical)
in
LateRate
E-14 clocked out at 17:05 and is not on the late rate. E-22 clocked out at 22:40 and is flagged for the late shift rate.
Example: a second, different use
Convert a time written as text, such as "14:30", into a time value so it can be compared with a cut-off.
Things to watch
- A time value has no date, so compare times only with times.
- Text times must match the culture if they use a different separator or a 12 hour clock.
- A time from a datetime keeps the hours, minutes and seconds.
- Null in gives null out.
In business terms
Payroll shift rules, cut-off times and time stamped controls depend on the clock time. A time column built from the source timestamp keeps those rules in the query where they can be checked.