Thanks Ernest.
I have used java.util.Date to solved my problem, but your solutions are better.

Ana

--- On Wed, 9/1/10, Ernest Friedman-Hill <[email protected]> wrote:

From: Ernest Friedman-Hill <[email protected]>
Subject: Re: JESS: Get the current year
To: "jess-users" <[email protected]>
Date: Wednesday, September 1, 2010, 7:12 AM

On Aug 31, 2010, at 11:58 PM, Donald Winston wrote:

> int year = Calendar.getInstance().get(Calendar.YEAR);
> 
> But you have to use static methods. Jess doesn't appear to let you do this.
> 


Sure it does! Two different ways to write this:


1)

(import java.util.Calendar)
(bind ?year ((Calendar.getInstance) get (Calendar.YEAR)))

2)

(import java.util.Calendar)
(bind ?year ((call Calendar getInstance) get (get-member Calendar YEAR)))


---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences          Phone: (925) 294-2154
Sandia National Labs
PO Box 969, MS 9012                            [email protected]
Livermore, CA 94550                             http://www.jessrules.com





--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [email protected]'
in the BODY of a message to [email protected], NOT to the list
(use your own address!) List problems? Notify [email protected].
--------------------------------------------------------------------




      

Reply via email to