user8868975
user8868975

Reputation:

Power apps how to display time in an hours:minutes:seconds format

I am developing an app in power apps. I need to be able to display the digital time in hours:minutes:seconds. Using Now() will only display hours:minutes.

How do I add seconds to the display?

Upvotes: 1

Views: 12830

Answers (1)

carlosfigueira
carlosfigueira

Reputation: 87258

You can use the Text Function to convert the date/time value that you get from the Now function with the format that you want:

Text(Now(), "hh:mm:ss")

If you want the time to be continuously updated, then you need to use a Timer control to set a variable, and use that variable in the Text function.

For example, on the Timer's OnTimerEnd property, you'd have something like

UpdateContext({now: Now()})

And on the label you'd have

Text(now, "hh:mm:ss")

Notice that the timer will not run in authoring mode, so you need to preview the app ("play" button in the top-right corner) to see it in action. It works fine in the published app.

Upvotes: 2

Related Questions