cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SimonMeadows
Advocate III
Advocate III

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 Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,489)