|
27.03.2024, 11:11 | #1 |
Участник
|
crmtipoftheday: Tip #1452: Compare dates in Power Automate
Источник: https://crmtipoftheday.com/1452/comp...power-automate
============== tl;dr Always use formatDateTime(), substring(), convertFromUtc(), convertTimeZone() to drop the time part and ensure the dates are in the same timezone. !tl;dr The datetime isn’t of any special type in Power Automate; it’s just a string representation of a timestamp in an ISO format. Yes, the format is sortable, so in theory, you could compare just the values. However, if you have a date input parameter in your flow, it comes as a date without any time part, so you might miss that birthday when comparing it to utcNow()! To further complicate matters, datetime values include both the time portion and a timezone indicator. What is today for you can be yesterday or tomorrow for other people. Time difference can be up to 25 hours (don’t get me started on that Samoa vs American Samoa trip again). And do you really want to compare seconds if you’re after just the date? Life becomes much easier if you follow two rules:
The post Tip #1452: Compare dates in Power Automate appeared first on Power Platform & Dynamics CRM Tip Of The Day. Источник: https://crmtipoftheday.com/1452/comp...power-automate
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|