cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1278
Views
0
Helpful
10
Replies

short date condition

emilio.pacheco
Level 1
Level 1

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 10

Anthony Holloway
Cisco Employee
Cisco Employee

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]

Thanks Anthony!!!

Hi Anthony,


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

Thanks!

Emilio

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.

emilio.pacheco
Level 1
Level 1

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,

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

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

Hi ,

What exactly are you writing?

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

Ervins

Hi,

I'm writing exactly that Anthony told me:

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

Emilio

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

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: