Hello everyone! Hope you all enjoyed my earlier articles on PAD (Power Automate Desktop). Today we will learn how to use DateTime and services actions in PAD. In this article, we will focus on the below actions of PAD.
1. Datetime: Get the date and time and perform time-related functions.
2. Services: Control the workstation’s related installed services.
Let’s start with DateTime and Services Actions in PAD.
As the name is self says a lot, most of the time in our day to day programming journey we need the DateTime function. We will then use DateTime action in power automate desktop with an example. Datetime action consists of the below functions.
– Add to DateTime
– Subtract dates
– Get current date and time
In the below example, we will use all three functions.
As you can see in the above example, I am retrieving the current system date. And subtracting five days from it by using Add to datetime function. Then finally showing the result in a display message.
Below screenshot is the output of the above flow.
Find the time difference between two given dates in days, hours, minutes or seconds. Let’s go through the below example to understand this function.
We are taking two variables datevar1 and datevar2 having 9/12/2020 and 15/12/2020 values respectively. After that I am using subtract dates function to get the difference.
This action is consists of the below functions.
1. Start service: Start a stopped window service
2. Stop service: Stop a running window service
3. Pause service: Pause a running window service
4. Resume service: Resume a paused window service
All the services functions just require a service name as an input field. In the above example, I am starting a print spooler service. One more important thing, I have launched my PAD as an administrator otherwise it will throw an access denied error.
Hope you all will like this post on DateTime and Services Actions in PAD. Please share this article and subscribe to our site for more articles on the power platform.