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 / Countdown day timer fo...
Power Apps
Answered

Countdown day timer for an event on the 28/06/26

(0) ShareShare
ReportReport
Posted on by 64
Good afternoon,
 
I hope everyone is doing well. I am not that expert with PA but have used a few times.
 
There is an event going live on the 28/06/2026. I need to do a countdown timer so that before the event it displays how many months, days, hours, minutes and possibly seconds left.
 
I have tried for example the days and put the below formula:
 
DateDiff(Now(), 28/06/2026, TimeUnit.Days) but is giving the value of -20474 instead of 158.
 
DateDiff(Now(), 28/06/2026, TimeUnit.Months) but is giving the value of -672 instead of 5.
 
I also need the hours and the minutes to start deducting from the current time and not sure how to do this. Furthermore, this needs to be like a widget launched from the desktop (not sure if this is possible?)

It needs to look like below with the values marked in red deducting every hour/minute.
 
If anyone could help that would be fantastic and I would really appreciate it.
 
Categories:
I have the same question (0)
  • Power Platform 1919 Profile Picture
    2,079 on at
    Hi ,
    Just adding to @ response , you can try this .
     
    With(
        { totalSecs: DateDiff(varStartDT, varEndDT, TimeUnit.Seconds) },
        With(
            {
                // Calculate days: total seconds divided by (24 hours * 60 minutes * 60 seconds)
                days:    RoundDown(totalSecs / (24 * 60 * 60), 0),
                // Calculate hours: remainder after removing full days, divided by (60 minutes * 60 seconds)
                hours:   RoundDown(Mod(totalSecs, 24 * 60 * 60) / (60 * 60), 0),
                // Calculate minutes: remainder after removing full hours, divided by 60 seconds
                minutes: RoundDown(Mod(totalSecs, 60 * 60) / 60, 0),
                // Calculate seconds: remainder after removing full minutes
                seconds: Mod(totalSecs, 60)
            },
            // Build a readable string output
            days & " days, " &
            hours & " hours, " &
            minutes & " minutes, and " &
            seconds & " seconds"
        )
    )
     
  • TheBest355 Profile Picture
    64 on at
     
    Thank you so much! Really appreciate your help. It has worked for the months and days but the hours and minutes are off but that's okay - I can try working that out using a timer to count down from the current hours/minutes left.
     
    Once again - thank you!
     
  • Verified answer
    WarrenBelz Profile Picture
    153,495 Most Valuable Professional on at
    Probably not the most elegant, but this should work
    With(
       {
          _Months: DateDiff(
             Now(),
             Date(2026, 6, 28),
             TimeUnit.Months
          ),
          _Days: DateDiff(
             Now(),
             Date(2026, 6, 28),
             TimeUnit.Days
          ),
          _Hours: Mod(
             DateDiff(
                Now(),
                Date(2026, 6, 28),
                TimeUnit.Hours
             ),
             24
          ),
          _Minutes: Mod(
             DateDiff(
                Now(),
                Date(2026, 6, 28),
                TimeUnit.Minutes
             ),
             60
          )
       },
       "Months: " & _Months & "  Days:  " & _Days & "  Hours:  " & _Hours & "  Minutes:  " & _Minutes
    )
     
    Please ✅ Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn  

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
Kalathiya Profile Picture

Kalathiya 401

#2
WarrenBelz Profile Picture

WarrenBelz 334 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 325 Super User 2025 Season 2

Last 30 days Overall leaderboard