How to get the day of the week from a date.(Power Automate Desktop)
Learn how to get the day of the week from a date in Power Automate Desktop.
Steps
First, the date/time variable is obtained from an action such as "Convert text to datetime" or "Get current date and time" or from various properties.
Then, for the acquired Datatime variable, use the property or action corresponding to the desired information.
Text:DayOfWeek property
DayOfWeek in the expression will get the day of the week in text.
%DatatimeVariable.DayOfWeek%
The result of the execution is as follows
- Monday
- Tuesday
- Wednesday
- Thursday
- Friday
- Saturday
- Sunday
Numeric: "Run JavaScript" action
To get it numerically, use the "Run JavaScript" action and run the following code.
WScript.StdOut.Write(new Date("%DatatimeVariable%").getDay() );
Day of week | Value |
---|---|
Monday | 0 |
Tuesday | 1 |
Wednesday | 2 |
Thursday | 3 |
Friday | 4 |
Saturday | 5 |
Sunday | 6 |
For those who want to learn Power Automate Desktop effectively
The information on this site is now available in an easy-to-read e-book format.
Or Kindle Unlimited (unlimited reading).
You willl discover how to about basic operations.
By the end of this book, you will be equipped with the knowledge you need to use Power Automate Desktop to streamline your workflow.
Discussion
New Comments
No comments yet. Be the first one!