cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
346
Views
5
Helpful
2
Replies
Highlighted
Beginner

Difference between dates as a value

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

Everyone's tags (3)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Participant

Re: Difference between dates as a value

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
Highlighted
Participant

Re: Difference between dates as a value

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

Highlighted
Beginner

Re: Difference between dates as a value

Actually that works better for me doing it that way.

Thank you so much !