cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SimonMeadows
Resolver I
Resolver I

Text() Function how to return only minutes

I am trying to get minutes only from a time value.

I initially assumed I could do:

Text(Start,"[$-en-US]mm")

But this returnes the wrong value.

I looked at the Text() documentation and found:

mmDisplays the minute as a number with a leading zero when appropriate. Note: The m or the mm placeholder must appear immediately after the h or hh placeholder or immediately before the ss placeholder. Otherwise, Text returns the month instead of minutes.

 

This suggests it is not possible to return only minutes from a date or time function.

Most functions to format timevalues provide 'MM' insetad of 'mm' for minutes.

So far the only way I have found to return only the minues is this:

Right(Text(Start,"[$-en-US]hh-mm"),2)

There must be a simpler way to return just minutes without having to trim strings.

1 ACCEPTED SOLUTION

Accepted Solutions
KMI-Keith
Advocate IV
Advocate IV

I think there is a Minute() syntax. I am trying to use it like so

Minute( Now() )

for a timestamp situation I am trying to figure out. Not sure if this would work for you, I dont know much about PowerApps yet.

Good Luck!

 

View solution in original post

3 REPLIES 3
KMI-Keith
Advocate IV
Advocate IV

I think there is a Minute() syntax. I am trying to use it like so

Minute( Now() )

for a timestamp situation I am trying to figure out. Not sure if this would work for you, I dont know much about PowerApps yet.

Good Luck!

 

View solution in original post

I had forgotten about the other time functions however I need the minutes in the two digit format which would require:

Text(Minute(Now()),"00")

 

Thanks for the suggestion.

 

NightKing
Advocate I
Advocate I

@SimonMeadows your Solution is working, the only one i know 😉:


@SimonMeadows wrote:

I am trying to get minutes only from a time value.

I initially assumed I could do:

Text(Start,"[$-en-US]mm")

But this returnes the wrong value.

I looked at the Text() documentation and found:

mmDisplays the minute as a number with a leading zero when appropriate. Note: The m or the mm placeholder must appear immediately after the h or hh placeholder or immediately before the ss placeholder. Otherwise, Text returns the month instead of minutes.

 

This suggests it is not possible to return only minutes from a date or time function.

Most functions to format timevalues provide 'MM' insetad of 'mm' for minutes.

So far the only way I have found to return only the minues is this:

Right(Text(Start,"[$-en-US]hh-mm"),2)

There must be a simpler way to return just minutes without having to trim strings.


 

Right(Text(Start,"[$-en-US]hh-mm"),2)

 

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (3,123)