Time.Minute

Updated on

Time.Minute is a Power Query M function that extracts the minute component from a given time, datetime, or datetimezone value. The function returns the minute component as a number.

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

Syntax

Time.Minute( dateTime as any ) as nullable number

Description

Time.Minute returns the minute component of the provided time, datetime, or datetimezone value, dateTime. This function extracts the minute portion from a time-related value and returns it as a number, ranging from 0 to 59.

Examples

Let’s look at how to use the Time.Minute function. This function, while categorized under Time functions, can extract the minute value from time, datetime, and datetimezone values.

Extracting Minutes from a DateTime Value

When you have a datetime value and you want to extract the minute component from it, you can use the Time.Minute function. Here’s an example:

// Output: 30
Time.Minute( #datetime( 2024, 9, 15, 20, 30, 1 ) )

In this example, #datetime( 2024, 9, 15, 20, 30, 1 ) represents September 15, 2024, at 8:30:01 PM. The Time.Minute function pulls out the minute part from this datetime value, which is 30.

Extracting Minutes from a DateTimeZone Value

The function also works with datetimezone values. This means you can extract the minute part from a datetime value that includes time zone information. Here’s how:

// Output: 45
Time.Minute( #datetimezone( 2024, 9, 15, 20, 45, 1, 2, 30 ) )

In this case, #datetimezone( 2024, 9, 15, 20, 45, 1, 2, 30 ) represents September 15, 2024, at 8:45:01 PM with an offset of +2 hours and 30 minutes from UTC. The Time.Minute function extracts the minute part, which is 45.

Extracting Minutes from a Time Value

You can apply the function to a time value as well.

// Output: 10
Time.Minute( #time( 12, 10, 0 ) )

In this scenario, #time( 12, 10, 0 ) represents 12:10 PM. The Time.Minute function extracts the minute value, which is 10.

Other functions related to Time.Minute are:

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

2023-2026 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy