IsUTCToday

How to Use the Power Fx IsUTCToday  Function in Power Apps

What is IsUTCToday?

IsUTCToday is a Power Fx function that returns true if the given DateTime value is on the current UTC date. The function compares the date part of the DateTime value with the current UTC date and returns true if they match.

Syntax

The syntax of the IsUTCToday function is as follows:


IsUTCToday(dateTime)


The dateTime argument is a DateTime value that you want to compare with the current UTC date.

How to Use IsUTCToday in Power Apps

Using the IsUTCToday function in Power Apps is straightforward. You can use it in various scenarios, such as checking if a date falls on the current UTC date or displaying a message if it does not.

Let’s look at some examples of how to use the IsUTCToday function in Power Apps.

Example 1: Checking If a Date Falls on the Current UTC Date

Suppose you have a date picker control in your Power App that allows users to select a date. You want to check if the selected date falls on the current UTC date.

To do this, you can use the IsUTCToday function in a formula that sets the Visible property of a label control. The formula would look like this:


IsUTCToday(DatePicker1.SelectedDate)


Here, we are passing the selected date from the date picker control to the IsUTCToday function. If the selected date is the current UTC date, the function will return true, and the label control will be visible.

Example 2: Displaying a Message if a Date Does Not Fall on the Current UTC Date

Suppose you have a SharePoint list that stores employee birthdays. You want to display a message to the user if the selected employee’s birthday does not fall on the current UTC date.

To do this, you can use the IsUTCToday function in a formula that sets the Text property of a label control. The formula would look like this:


If(IsUTCToday(EmployeeList.Selected.Birthdate),"Happy Birthday!","Sorry, it's not your birthday today.")


Here, we are passing the birthdate of the selected employee from the SharePoint list to the IsUTCToday function. If the birthdate is the current UTC date, the function will return true, and the label control will display “Happy Birthday!”. Otherwise, the label control will display “Sorry, it’s not your birthday today.”

The IsUTCToday function in Power Apps is a handy tool that allows you to compare a DateTime value with the current UTC date easily. Whether you need to check if a date falls on the current UTC date or display a message to the user, the IsUTCToday function can help you achieve your goal. With the examples provided in this article, you can now start using the IsUTCToday function effectively in your Power Apps.

Power Apps Training Courses by G Com Solutions (0800 998 9248)