cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
821
Views
5
Helpful
2
Replies

Difference between dates as a value

tom.miller1
Level 1
Level 1

Hi

 

I am trying to figure out a way to take two dates in format of DD/MM/YYYY and create a value of the difference 

 

e.g.CCX Editor CCX Editor 

 

String 1 = 18/08/2018

String 2 = 20/08/2018

 

Then some how with a set feature maybe create a new string that equals the difference

 

so String 3 = 2

 

Anyone know if this is possible or recommend a better way to do it.

 

Ultimately what I want to do in the end is have an increment of days and after x number of days ( 7 in this case) do something else so would end up running a different aspect of the script

 

Sort of if (String 3 =<7) Then

 

Thanks in advance

1 Accepted Solution

Accepted Solutions

Sean Lynch
Level 7
Level 7

I'm not sure if I would evaluate it as a variable type String.  You could actually change the dates to "day of the year" using the .doy function and mathematically evaluate them.  Once you calculate difference use a logic palette item or evaluation (switch, if / then, etc.) to follow the path you want your script to go down...

 

I toyed with it this way:

2018-0820-daysAgo2.png

View solution in original post

2 Replies 2

Sean Lynch
Level 7
Level 7

I'm not sure if I would evaluate it as a variable type String.  You could actually change the dates to "day of the year" using the .doy function and mathematically evaluate them.  Once you calculate difference use a logic palette item or evaluation (switch, if / then, etc.) to follow the path you want your script to go down...

 

I toyed with it this way:

2018-0820-daysAgo2.png

Actually that works better for me doing it that way.

Thank you so much !