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 III
Super User III

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 III
Super User III

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

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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (3,065)