cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

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

Anonymous
Not applicable

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 @Anonymous

 

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!


Anonymous
Not applicable

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

Anonymous
Not applicable

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 @Anonymous

 

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 @Anonymous 🙂


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

Gustavo Moraes, o astronauta brasileiro do Flow!


Girish-Kalamati
New Member

Re: Today minus 6 month

Cool that helps 🙂

Helpful resources

Announcements
Did you attend MBAS? Claim your badge

Attending MBAS? Claim your badge

Whether you’ve streamed the digital event live, or you're watching on-demand, claim your attendee badge to sport on your profile.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (5,274)