Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

Date Testing



So with the help of ,@v-yamao-msft, I have manged to get information on the leap years compose functions into flow, very helpful as per the below link.


Leap Years


The flow that uses the leap year compose functions is basically triggered on receipt of email from an initial flow that is sent requesting a new certificate.  As I cannot expect my supplier to rename the certificate file in a specific format I have decided to check if the email address of the incoming email matches that of one in a SharePoint list, this works fine.  I then need to test if the current expiry date is a leap year, and the rough and ready testing I have done works.  It then gets the attachment of the email and saves this to a specific location, which works to.  The basic flow looks like the below:


Leep Year 2.png 


The issue I have is physically doing the leap year testing in its true sense.  So, with a scenario of a current expiry of say 30/11/2018 this date is not a leap year, if I add 365 to that this is still not a leap year.  However, if you add another 365, this will be a leap year so writing that date to a SharePoint list will result in the date being 29/11/2020 and not 30/11/2020 as it should be.  So somehow, I need to have another compose action that maybe adds 365 days to the current expiry date and then test that against the other compose to determine it a leap year.


The next issue is I want to rename the suppliers certificate to something else, again the rough and ready testing I have done works.  I suppose again I need to use the compose action above as the date field of the filename but then change this to say a UK GMT region format.  I have done that before so that should not be a problem and have used the following:


convertTimeZone(utcnow(),'UTC','W. Europe Standard Time','dd MM yyyy')


But the issue I will have is incorperating the new date somehow in a an expression of some form of compose.  


So I need a little further helps please with the leap year side of things.  The above has to be acheiveable, I do not think I am expecting too much.





Community Support Team
Community Support Team

Re: Date Testing



I am afraid I have no way to see what the information provided in your screenshot is.

So I am not sure what your specific purpose is to determine if the date is a leap year.

What you mean is that the method to judge leap year is not working here, or you need more improvement to meet your Flow requirements.

If you are struggling to add 365 or 366, you could get the year of the next year and then use a similar method to determine if it is a leap year. If yes, add 366; if not, add 365

Please provide more details about your requirements, it seems that this post is only part of.


Best Regards,


Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Level: Powered On

Re: Date Testing

Barry @v-bacao-msft,


I am moving this all to the below post:



This will be maked as an accepted solution when the above post has been resolved.  Sorry for cross posting never a good idea on this forum.







Helpful resources


New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!


Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!


Microsoft Learn

Learn how to build the business apps that you need.


Power Platform World Tour

Find out where you can attend!


Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,107)