cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate IV
Advocate IV

Realtime Date Time display in Text Box

It is probably obvious, but I haven't found the simplest way to continuously update Date and Time in a Text Box.

ThisItem.Text=Now()  Is static and doesn't refresh (which I think is normal)

Using a timer and setting the Text property of a Text Box to Timer.Value works, the Text Box gets updated,  I tried using a timer with the OnTimerEnd Event, but didn't find a way to use it to update the Text Property of a Text Box.

The only idea I have is not very satisfying: use a concatenation of the Now() result and Timer.Value for the seconds, which is a bad hack.

Thanks for the help.

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Realtime Date Time display in Text Box

Hi Olivier,

 

About this issue, using a Timer control would be a good choice. I added a TextBox control and a Timer control in my App.
>About Timer control, I set its AutoStart and Repeat property to True, Duration property to 60000, OnTimeEnd property to UpdateContext({textbox1:Text(Now(),"dd/mm/yy hh:mm:ss")}).
>About TextBox control, I set its Text property to textbox1.

 

This works well for me, when the Timer ends, the Date and Time would be refreshed in the TextBox control. As a workaround, please try if this works for you.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: Realtime Date Time display in Text Box

Hi Olivier,

 

About this issue, using a Timer control would be a good choice. I added a TextBox control and a Timer control in my App.
>About Timer control, I set its AutoStart and Repeat property to True, Duration property to 60000, OnTimeEnd property to UpdateContext({textbox1:Text(Now(),"dd/mm/yy hh:mm:ss")}).
>About TextBox control, I set its Text property to textbox1.

 

This works well for me, when the Timer ends, the Date and Time would be refreshed in the TextBox control. As a workaround, please try if this works for you.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Advocate IV
Advocate IV

Re: Realtime Date Time display in Text Box

Thank you Mabel,

I didn't try it yet, but I am sure it works!  I didn't know you could use UpdateContext() on a control's property, so thanks for that.

I will use this every second rather than every minute just so the time difference between actual time and displayed time is a max of one second.

Highlighted
Advocate IV
Advocate IV

Re: Realtime Date Time display in Text Box

Hi again Mabel,

 

It works!

Thanks,

 

Olivier

Highlighted
Advocate IV
Advocate IV

Re: Realtime Date Time display in Text Box

Hi again Mabel,

 

 

It works, thanks.

Olivier

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,409)