Recently while working on Power Automate to send notification if custom activity record is completed before 15 day but still invoicing is not done yet, I was facing time zone issue while comparing date. I will provide details how I sold this issue.
1. Here I formatted date from CRM to match particular format
2. Here I formatted the date I want to compare in the same format (15 days before current date)
But result was not coming correctly, while troubleshooting I printed date on a temp variable but dates were not coming correctly. There was difference in the date. While doing troubleshooting further I found we can use Convert Time zone action to convert date time to specific time zone, so I changed my flow like below
After that I got date formatted correctly.
While working on the date comparison CRM date and the other date can be on the different format, you can use variable to print them and see if they are coming different format. If yes, you can use Convert Time Zone action.
Hope it will help someone!
Keep learning, Keep sharing !!