cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
488
Views
0
Helpful
1
Replies

If date check scripting

JonesR
Level 1
Level 1

Hello all,

I am trying to do a if statement date check, what i would like to do is for the system to check the date, and if it falls between for example 10 Feb and 24 April = true else false. Below is something i have come up with but keep getting errors and am now going around and around.

 

Set i_date = D[now]

If (i_date.date => 18 && i_date.month => 02) && (i_date.date <= 14 && i_date.month <= 04)  == true 

 

However i am getting a little confused what type of variable type to use either, int, String or Date? Also on the check "=>" is it possible to use a variable instead of hard coding it into the script then I can set that variable to be a parameter. 

 

Thanks for your help.

 

Rich

1 Accepted Solution

Accepted Solutions

Anthony Holloway
Cisco Employee
Cisco Employee

You should see some success with the following

 

E.g.,

d[now] >= d[2/10/2018] && d[now] <= d[4/24/2018]

 

View solution in original post

1 Reply 1

Anthony Holloway
Cisco Employee
Cisco Employee

You should see some success with the following

 

E.g.,

d[now] >= d[2/10/2018] && d[now] <= d[4/24/2018]