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!

 

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,170)