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

Today minus 6 month

I want to check a condition of weather a VariableTime == Today minus 6 month.

How can i do this. Is this possible with utcNow()?

 

Like this way?

reminder.PNG

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Today minus 6 month

You need to compare Date/Time or only date?

 

If you need only date use this:

 

 

@equals(ticks(concat(formatDateTime(items('Auf_alle_anwenden')?['K_x00fc_ndigungstermin'], 'yyyy-MM-dd'), 'T00:00:00Z')), ticks(concat(formatDateTime(addDays(utcnow(), -180), 'yyyy-MM-dd'), 'T00:00:00Z')))

 

 

You can use compose to see the result of individual parts to confirm the result

 

 


Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


View solution in original post

sfoerst
Level: Powered On

Re: Today minus 6 month

It works!

My condition is shown in the screenshot

 

formatDateTime(addDays(utcNow(), -180),'yyyy-MM-dd')

i manipulated your code in the other way

 

x-6.PNG

 

Thank you!!!!!!! It was a hard work for me 😉

 

View solution in original post

6 REPLIES 6
Super User
Super User

Re: Today minus 6 month

Hi @sfoerst

 

To transform utcNow() to minus 6 month use this:

 

 

adddays(utcNow(), -180)

Now, to compare if the column value is greater then date you need to format the two values, i recommend use ticks(), like this:

For today date:

 

ticks(adddays(utcNow(),-180))

 

For column value:

 

ticks(triggerBody()?['NAME OF YOUR COLUMN'])

the final result in condiction in advanced mode should be:

 

 

 

@equals(ticks(triggerBody()?['NAME OF YOUR COLUMN']), ticks(adddays(utcNow(), -180)))

Hope this helps!

 

Best Regards,

 

Gustavo Moraes

 

 

 

 

 


Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


sfoerst
Level: Powered On

Re: Today minus 6 month

I tried this with a column from a sharepoint list. Is a variable necessary?

 

@lessOrEquals(ticks(items('Auf_alle_anwenden')?['K_x00fc_ndigungstermin']), ticks(addDays(utcNow(), -180)))

 

something doesn't work

lessOrEquals is only for testing final should be Equals

Super User
Super User

Re: Today minus 6 month

You need to compare Date/Time or only date?

 

If you need only date use this:

 

 

@equals(ticks(concat(formatDateTime(items('Auf_alle_anwenden')?['K_x00fc_ndigungstermin'], 'yyyy-MM-dd'), 'T00:00:00Z')), ticks(concat(formatDateTime(addDays(utcnow(), -180), 'yyyy-MM-dd'), 'T00:00:00Z')))

 

 

You can use compose to see the result of individual parts to confirm the result

 

 


Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


View solution in original post

sfoerst
Level: Powered On

Re: Today minus 6 month

It works!

My condition is shown in the screenshot

 

formatDateTime(addDays(utcNow(), -180),'yyyy-MM-dd')

i manipulated your code in the other way

 

x-6.PNG

 

Thank you!!!!!!! It was a hard work for me 😉

 

View solution in original post

Super User
Super User

Re: Today minus 6 month

Hi @sfoerst

 

Very good!!!

 

Only one thing to pay attention, i didn't a hard tests to see if flow compare date as date or as string, if it compare as string  we need use the 'tick'.

 

Thanks @sfoerst 🙂


Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


Girish-Kalamati
Level: Power Up

Re: Today minus 6 month

Cool that helps 🙂

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

New & Improved Power Automate Community Cookbook

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

thirdimage

Power Automate Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (4,523)