There's some math functions but no date functions. see Jess71p2-1/docs/function_index.html You can use java from Lisp to do this.
(bind ?ms ((new java.util.Date) getTime)) (bind ?year (integer (+ 1970 (/ (/ (/ (/ (/ ?ms 1000) 3600) 24) 365.25 ))))) (printout t ?year crlf) getTime() is deprecated. The proper way to get the time is from java.util.Calendar. int year = Calendar.getInstance().get(Calendar.YEAR); But you have to use static methods. Jess doesn't appear to let you do this. On Aug 24, 2010, at 12:08 PM, ANA TANASESCU wrote: > Hello everybody, > > I want to define a rule that makes the difference between the year of the > current date and the year from a slot in my ontology. > Is there a function that gets the current date or the year from the current > date? > > I am looking forward for your answer. > Best regards, > Ana > -------------------------------------------------------------------- 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]. --------------------------------------------------------------------
