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

Attention: The Community will be in read-only mode on 12/14/2017 from 12:00 am pacific to 11:30 am.

During this time you will only be able to see content. Other interactions such as posting, replying to questions, or marking content as helpful will be disabled for few hours.

We apologize for the inconvenience while we perform important updates to the Community.

New Member

short date condition

Hi,

I've this condition: If (date.after(D[19 de marzo de 2010 00:00:00]) && date.before(D[7 de mayo de 2010 00:00:00]) ) Then.

But i want ask without the year and time, how can i do?

Thanks!!

Emilio

10 REPLIES

Re: short date condition

Take a look at the UCCX Scripting and Development Series: Volume 3, Expression Language Reference Guide

There is a section on Date literals, and it shows you the valid formats.

I have quoted a portion of the document here for quick review:

Example Date Literals:

     D[12/13/52]

     D[Dec 13, 1952]

     D[Thu, July 4, 2002]

     D[July 5, 2002]

     D[July 7, 2002]

     D[7/6/02]

     D[Thu, July 4, 2002 5:59 PM]

     D[July 5, 2002 5:59 PM]

     D[July 7, 2002 5:59 PM]

     D[7/6/02 5:59 PM]

     D[Thu, July 4, 2002 12:23:59 AM]

     D[July 5, 2002 12:23:59 AM]

     D[July 7, 2002 12:23:59 AM]

     D[7/6/02 12:23:59 AM]

     D[Thu, July 4, 2002 12:23:59 AM CST]

     D[July 5, 2002 12:23:59 AM CST]

     D[July 7, 2002 12:23:59 AM CST]

     D[7/6/02 12:23:59 AM CST]

     D[now]

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.
New Member

Re: short date condition

Thanks Anthony!!!

New Member

Re: short date condition

Hi Anthony,


But i don't want control the year, i only want control day and month, how can i do?

Thanks!

Emilio

Re: short date condition

Oh I see, so you were not asking what the valid formats are, you were asking how to compare two dates, without considering the year and time?

You can compare parts of the date like this:

if (d[now].month >= d[February 1, 2010].month)

     /* The current month is, or is after February */

} else {

     /* The current month is before February */

}

And dates are accessed like this:

d[now].date

Message was edited by: Anthony Holloway - Typo on February...corrected now.

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.
New Member

Re: short date condition

Hi,

I'm trying to write this:

date.month >= date[Febraury 1, 2010].month

but send me an error when i click in Apply... i use variable date, where date = D[now]

The error is "Unable to parse expression; Couldn't repair and continue parsing on token #INTEGER "1" (line: 1, col:30)" and refer with the day

Regards,

Re: short date condition

it's d[] not date[].  =)

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.
New Member

Re: short date condition

Hi,

With d[now] neither work, i've the error "Unparseable date: "Febraury 1, 2010"

What version have you got? i've 5.0

Thanks!

Regards,

Emilio

New Member

Re: short date condition

Hi ,

What exactly are you writing?

It should look like D[now].date or D[now].month

Ervins

New Member

Re: short date condition

Hi,

I'm writing exactly that Anthony told me:

d[now].month >= d[Febraury 1, 2010].month

Emilio

Re: short date condition

I spelled February wrong, and you copied my mistake.  sorry. 

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.
447
Views
0
Helpful
10
Replies
CreatePlease to create content