cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
walteroa
New Member

Cannot substract two dates values in flow.

sorry if my question is too basic, but im newbie.

 

Issue: I need to substract 2 dates that come in UTC format (i guess using RFC3339).

 

Context: I have 2 dates from Planner that goes to an HMTL table, but I coudnt find the way to calculate the days past between them:

 

Date#1: 2020-09-21T20:57:09.5169918Z

Date#2: 2020-10-11T08:41:19.3174429Z

 

i've tried using ticks function, without any result. I also tried "SubtractFromTime" os symply sub function without any results.

 

is there any date& time action block or function to deal with this basic issue?

 

I'm really lost in the desert 😞

Thx in advance

 

1 ACCEPTED SOLUTION

Accepted Solutions
CFernandes
Super User
Super User

Hey @walteroa 

 

Please try this - https://powerusers.microsoft.com/t5/Building-Power-Apps/how-to-get-difference-between-two-dates-in-f... 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

8 REPLIES 8
CFernandes
Super User
Super User

Hey @walteroa 

 

Please try this - https://powerusers.microsoft.com/t5/Building-Power-Apps/how-to-get-difference-between-two-dates-in-f... 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

rathour007
Regular Visitor

Thx @CFernandes and @rathour007

I've tried. Unfortunately no success. I think I have something wrong...

The ticks are not working to me when I pass the UTC string in order to convert to integer.

 

rationale: 

a) variable string "CreationDate" comes from planner in UTC format

b) variable string "Now" using utcnow()

 

to substract >>   DiffAsMinutes=Now-CreateDate  seems to be string instead of integer

 ticks0.PNG

 

ticks1.PNG

 

 

Then, as a result, the output from DiffAsMinuts comes up with string instead of integer. hence error to setup the variable with does not allow to receive an string.

 

ticks2.PNG

 

ticks3.PNG

 

Have you tried int(outputs('EndTimeTickValue')) and int(outputs('StartTimeTickValue')) to convert the values in integer?

ajdhingr
Microsoft
Microsoft

@walteroa your issue still exists ?

Little update: perhaps a sintax error on DiffAsMinutes expression.

Already solved:

ticks4.PNG

 

 

nope. Already solved. Thx!

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (3,457)