Power Automate: How to get todays date and current time.

Power Automate: How to get todays date and current time.

ยท

2 min read

We can go down 2 paths to get current date or current datetime in Power Automate.

  • Using Inbuilt Action

  • Using formula

How do I get the todays date and time without writing formula?

This is the easiest method, and you don't have to compose any formula. There is an inbuilt action on Power Automate to get todays date and current time.

Go to New Step >> Date Time Category or search Date Time >> Select Current Time Action.

("No additional information is required for this step" ๐Ÿ˜Š)

Hit save and run a test.

Here are the results.

You'll get a UTC date and time value of current time.

  •       "2023-12-29T08:23:55.7425432Z"
    

How do I get the todays date and time with formula?

Add a Compose Action and write this formula.

utcNow()

here is the result.

How do I convert UTC to local time in Power Automate?

The return value is in UTC (Coordinated Universal Time). Let's convert this to different time zone.

add new step >> Convert time zone.

Hit save and test.

{
  "body": "Friday, December 29, 2023"
}

How do I get Year from the current date in Power Automate?

There is no direct action available for that function, but we can compose a function to get the year from the date.

add this formula.

formatDateTime(body('Convert_time_zone'), 'yyyy')

How do I get Month from the current date in Power Automate?

We can compose a function to get the Month name or Month number from the date.

add this formula for Month name.

formatDateTime(body('Convert_time_zone'), 'MMMM')

add this formula for Month number.

formatDateTime(body('Convert_time_zone'), 'MM')

How do I get Day or Weekday from the current date in Power Automate?

We can compose a function to get the Day or Weekday from the date.

add this formula for Day of the month.

formatDateTime(body('Convert_time_zone'), 'dddd')

add this formula for day of the month.

formatDateTime(body('Convert_time_zone'), 'dd')

ย