Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Bronze

ICM 7.1 Script Functions (date and now)

I have traditionally used the following formula in scripting to determine if today's date is a specific date for things such as holidays. I use this formula in an IF node.

now()=date(2007,07,26)

Every time I tested it was returning a False value. In order to see what was actually being returned for both functions, I set a variable equal to the results from both and ran call tracer. What I found out was that they were returning values just 1 digit apart. I went to the routers to ensure that the date was set correctly on both machines. Anyone else ran into this? If someone is running 7.1 would you mind running this test? Of course, be sure to change the value of the date to represent the date on which you are testing.

Note... I have always used this formula in a release 6 environment with no issue.

Thanks!

5 REPLIES
Bronze

Re: ICM 7.1 Script Functions (date and now)

Here is a screenshot of the call trace I did the other day

Gold

Re: ICM 7.1 Script Functions (date and now)

Hi,

I am using this formula in a 7.1(4) IPCC enviroment:

concatenate(month(date()),"/",day(date()))

Hope this helps,

Juan Luis

Bronze

Re: ICM 7.1 Script Functions (date and now)

Thanks Luis. My only problem with that is I'm still not sure if it's the NOW function or DATE function that is returning the incorrect value. If it's the DATE function than this formula leaves me in no better position. I'll give it a shot this afternoon though. At least I can then narrow it down to which function is correct. Thanks!

New Member

Re: ICM 7.1 Script Functions (date and now)

I have a system using 7.1.5 that I just tried the following command on and it returned false also: now()=date(2007,07,31). Try using date()=date(2007,07,31) instead of now(). That is working successfully for me and what I have typically used.

Re: ICM 7.1 Script Functions (date and now)

Hello there,

actually, it is quite enough to take a look at the scripting guide :-)

http://cisco.com/application/pdf/en/us/guest/products/ps1001/c1626/ccmigration_09186a00804d719a.pdf

Date and Time functions...

date [ (date) ]

Integer

Returns the current system date or the date portion of a given date-time value. The given date can be a floating point value (as returned by the now function), a string of the form mm/dd/yy, or three integers: yyyy, mm, dd. date (with no arguments)returns the current date. = date(2001, 7, 15) tests whether the current date is July 15,2001.

653
Views
0
Helpful
5
Replies
CreatePlease to create content