I think Myriam Abramson wrote:
>
> Hi!
>
> I want to display a date in a user-friendly format. I thought I'll
> do
> (bind ?date (new Date 734898240))
> <External-Address:java.util.Date>
> (printout t ?date crlf)
> <External-Address:java.util.Date>
> but that does not give me the nice formatting of Java as in
> System.out.println (date);
> Fri Jan 09 07:08:18 EST 1970
>
> How can I do that in Jess?
When you call println() on an Object in Java, the method calls
toString() on the object to get the actual text to display. Jess
doesn't do this automatically because I've always argued it would be
confusing (although this behavior may change, at least as an option.)
But nothing stops you from doing this yourself:
Jess> (printout t (?date toString) crlf)
Fri Jan 09 07:08:18 EST 1970
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov
--------------------------------------------------------------------
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]
--------------------------------------------------------------------