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 Automate / Set variable to datetime
Power Automate
Unanswered

Set variable to datetime

(0) ShareShare
ReportReport
Posted on by 133

i would like to test my app and run it on specific time. i figure that setting the datetime would be a great idea but it seems like i am having some issues currently. How should i set the variable to a date time variable?

Appleonwindows_0-1710980953279.png

 

  • CU16071609-1 Profile Picture
    6,255 Moderator on at

    @Appleonwindows 
    Are you currently operating within a flow with Power FX enabled?

    Please try copying and pasting the provided code to verify if it functions correctly.

    Deenuji_0-1710994539025.png

    Code:

     

     

    DateTime.GetCurrentDateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateAndTime CurrentDateTime=> CurrentDateTime
    SET Dayofweek TO CurrentDateTime.DayOfWeek

     

     

     

    Are you new to Power Automate Desktop and unsure how to copy and paste the code provided?

    Deenuji_1-1710994768019.gif

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀. If you'd like to appreciate me, please write a LinkedIn recommendation 🙏

     
     
  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    If you want to manually set a specific value as a date, set it first, and then use Convert text to date time to convert it to a valid datetime value.

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

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 423

#2
11manish Profile Picture

11manish 308 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 177

Last 30 days Overall leaderboard