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 Apps
Unanswered

RoundDown UTC time

(0) ShareShare
ReportReport
Posted on by 35

How would I round down the current time in UTC format to the nearest hour or 30 minute interval?

E.g:

Time now = 02/14/2020, 14:28

So I want to set a variable to = 02/14/2020, 14:00 (rounding down to the nearest hour or 30 minute interval)

Categories:
I have the same question (0)
  • Verified answer
    mdevaney Profile Picture
    29,989 Moderator on at

    @PGTips 

    Please try this code:

     

    Set(myDateVariable,
     Today()
     + Time(Hour(Now(),RoundDown(Minute(Now())/30,0),0)
    )

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • GarethPrisk Profile Picture
    2,828 on at

     

    DateAdd(
     Now(),
     (Minute(Now()) * - 1) + If(
     Minute(Now()) >= 30,
     30,
     0
     ),
     Minutes
    )

     

    The previous response works as well. Thanks @mdevaney

     

    EDIT: Corrected mine to account for the 30 minute interval requirement.

  • PGTips Profile Picture
    35 on at

    Amazing, thanks! And then finally, how would I convert to this format: "2020-02-14T09:00:00"

  • mdevaney Profile Picture
    29,989 Moderator on at
    @PGTips
    Like this. Try it out in the Text property of a label.

    Text(myDateVariable,”yyyy-mm-dd”)&”T”&Text(myDateVariable,”hh:mm:ss”)

    —-
    Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard