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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / DatePicker 2 Functions...
Power Apps
Unanswered

DatePicker 2 Functions - Set Start Date when App was opened / reseted & Select current Date

(0) ShareShare
ReportReport
Posted on by 53

Hi all,
I have a question. I want to create a time tracking application where the person clicks on it at the beginning and then the start date is automatically set to when the person opened the application and the end date is set to when the person clicks on "Submit Time Tracking". How do I need ti set up the Date Picker fields

KT03_1-1698238115798.png

 

Categories:
  • SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at

    Hi @KT03 

     

    To set the start date and time automatically when the app is opened you can use the Now() function to get the current date and time, and assign it to a variable or a data source field. You can use the OnStart property of the app or screen to set the start date and time.

    Set(StartTime, Now())

     

    To set the end date and time automatically when the user clicks on "Submit Time Tracking", you can use the same Now() function to get the current date and time, and assign it to another variable or data source field. You can use the OnSelect property of a button to set the end date and time.

    Set(EndTime, Now())

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • KT03 Profile Picture
    53 on at

    Works for the Start Time but somehow it does not work for the Hour and Minute field? 

    Start Date:
    Date: Today()
    Hour: Text(Hour(Now());"00")
    Minute: Text(Minute(Now());"00")

    Do i need to use a different formula?

    Update Button: Set(Var2; Now())
    End Date:
    Date: If(IsBlank(Var2);Parent.Default;Var2)
    Hour: If(IsBlank(Var2);Parent.Default;Var2)
    Minute: If(IsBlank(Var2);Parent.Default;Var2)

     

    KT03_0-1698240196483.png

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard