web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Display current date/t...
Power Apps
Answered

Display current date/time in component

(0) ShareShare
ReportReport
Posted on by 25

Hi, i want to create a simple component that displays the current date/time in a textfield.

 

I have the following in my app but there is an error when i try to use UpdateContext in components.

 

Timer OnStart and OnEnd:

 

 

UpdateContext({_datetime: Text( Now(), "dd/mm/yyyy hh:mm AM/PM" )});

 

 

Duration: 10s

 

 

 

Categories:
I have the same question (0)
  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @rethc 

     

    UpdateContext won't work with components since UpdateContext scope is screen level but components can be used on many screens.

     

    So we need to use Set instead of UpdateContext

    Set(_datetime, Text( Now(), "dd/mm/yyyy hh:mm AM/PM" ));

     

  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    Hi @rethc :

    please turn on the component's 'Access app scope' function and try again.

    vbofengmsft_0-1633317575242.png

    Best Regards,

    Bof

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard