Subj : best way to create native javascript date from Java with Rhino To : netscape.public.mozilla.jseng From : barnabas.wolf@mssm.edu (Barnabas Wolf) Date : Sun Feb 02 2003 02:32 pm What is the best way to create a JavaScript Date object from Java? Rhino wraps java.util.Date's using NativeJavaObject; it does not convert them to NativeDate. I am currently using a workaround in a WrapFactory: if (val instanceof java.util.Date) { long time=((java.util.Date) val).getTime(); return cx.evaluateString( scope, "new Date(" + time + ");", "date conversion", 1, null) } Is there a better way to do this? (More efficient or more elegant way?) Is there a specific reason Rhino is not able to convert Dates into native types, like it can with Numbers and Strings? Thanks, Barnabas .