#time

Updated on

#time is a Power Query M function that creates a time value from numbers representing the hour, minute, and (fractional) second.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

#time(
   hour as number,
   minute as number,
   second as number,
) as time

Description

Creates a time value from numbers representing the hour, minute, and (fractional) second. Raises an error if these conditions are not true:

  • 0 ≤ hour ≤ 24
  • 0 ≤ minute ≤ 59
  • 0 ≤ second < 60
  • if hour is 24, then minute and second must be 0

Examples

Returns the time 05:10:30

#time( 5, 10, 30 )

The value consist of hours, minutes and second which you can easily extract.

Time.Second( #time( 5, 10, 30 ) ) // Returns 30

Time.Minute( #time( 5, 10, 30 ) ) // Returns 10

Time.Hour( #time( 5, 10, 30 ) ) // Returns 5

Other functions related to #time are:

BI Gorilla Blog

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/sharptime