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 / Timer continue to coun...
Power Apps
Answered

Timer continue to count after Time has elapsed

(0) ShareShare
ReportReport
Posted on by 321

 

I use datediff to set countdown timer. Even after end date (03/15/2024) has elapsed, it continue counting in negatives. I expected to end at 0 Days and 0 Hours.

 

 

timer.PNG

 

For the days, i have this code
DateDiff(Now(), DateValue("03/15/2024"))

For the hours, i have theis code

DateDiff(TimeValue(Now()), TimeValue("17:00:00"),TimeUnit.Hours)

 

Categories:
I have the same question (0)
  • Verified answer
    Yogesh Murugan Profile Picture
    443 Moderator on at

    Try this

    //Days
    Set(
     CountdownDays,
     DateDiff(
     Now(),
     DateValue("03/15/2024"),
     TimeUnit.Days 
     )
    );
    //Time
    Set(
     CountdownHours,
     DateDiff(
     Now(),
     DateTimeValue("03/15/2024 17:00:00"),
     TimeUnit.Hours 
     )
    );
    
    
    If(
     CountdownDays < 0,
     Set(CountdownDays, 0)
    );
    
    If(
     CountdownHours < 0,
     Set(CountdownHours, 0)
    );
    
    
    
    //Label
    "Countdown: " & CountdownDays & " Days : " & CountdownHours & " Hours"
  • BhaskarDhone Profile Picture
    1,392 Super User 2025 Season 2 on at

    add below formula on lable.

    If(
     Now() <= DateValue("03/19/2024") + TimeValue("20:00:00"),
     If(
     DateDiff(Now(), DateValue("03/19/2024") + TimeValue("20:00:00"), TimeUnit.Days) = 0,
     Concatenate(
     "0 days ",
     Text(Mod(DateDiff(Now(), DateValue("03/19/2024") + TimeValue("20:00:00"), TimeUnit.Hours), 24), "[$-en-US]0"), " hours ",
     Text(Mod(DateDiff(Now(), DateValue("03/19/2024") + TimeValue("20:00:00"), TimeUnit.Minutes), 60), "[$-en-US]0"), " minutes "
     ),
     Concatenate(
     Text(DateDiff(Now(), DateValue("03/19/2024") + TimeValue("20:00:00"), TimeUnit.Days)), " days ",
     Text(Mod(DateDiff(Now(), DateValue("03/19/2024") + TimeValue("20:00:00"), TimeUnit.Hours), 24), "[$-en-US]0"), " hours ",
     Text(Mod(DateDiff(Now(), DateValue("03/19/2024") + TimeValue("20:00:00"), TimeUnit.Minutes), 60), "[$-en-US]0"), " minutes "
     )
     ),
     "0 days 0 hours 0 minutes"
    )
  • codeworks Profile Picture
    321 on at

    Thanks for your effort and time !! Your solution works also, but i will go with the solution poster posted by @YogeshMurugn .

  • codeworks Profile Picture
    321 on at

    I would like to add minutes

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