TL;DR: Format dates directly with utcNow('your-format') instead of wrapping it in a separate formatDateTime call.

🧰 Free tool: Test your utcNow() / formatDateTime format strings with a live preview (remember: MM is month, mm is minute): utcNow date format tester.

💡 Challenge

Working with dates and times often requires using formatDateTime with utcNow to format values, adding unnecessary complexity and extra steps in your flow.

✅ Solution

Format the date directly within utcNow by passing your desired format string, eliminating the separate formatDateTime function.

🔧 How It’s Done

1. Use utcNow with format parameter

🔸 Instead of using formatDateTime(utcNow(), 'your-format'), call utcNow('your-format').

2. Apply your date-time format

🔸 Use the same format string you need directly inside utcNow.

3. Test your flow

🔸 Run and verify your flow in a non-production environment to ensure it works as expected.

🎉 Result

By directly formatting dates within utcNow, you simplify and streamline your flows, reducing steps and improving readability and performance.

🌟 Key Advantages

🔸 Simplicity: Eliminates the need for an additional formatDateTime function.

🔸 Efficiency: Reduces the number of expressions in your flow.

🔸 Clarity: Makes your flow easier to read and maintain.


🛠️ FAQ

1. What format strings can I use with utcNow()?

You can use standard .NET DateTime format strings like ‘yyyy-MM-dd’, ‘HH:mm:ss’, or custom combinations to format the date and time as needed.

2. Is utcNow() always in UTC timezone?

Yes, utcNow() always returns the current time in UTC. If you need local time, consider using the convertTimeZone() function.

3. Can I combine utcNow() formatting with other functions?

Absolutely! You can chain utcNow() with other functions like addDays(), addHours(), or use it within expressions for complex date calculations.

Need Help with Your Power Platform Project?

Get expert guidance through personalized workshops, consulting, and training tailored to your specific needs.

Request Workshop

Consulting and process automation for SMBs is delivered by KMUpower. Prefer structured, German-language courses? The Power Platform Academy offers live Power Platform Schulung and hands-on Power Platform courses for Power Apps, Power Automate and Copilot.