From: adam Date: Thu, 23 Sep 2004 07:05:29 +0000 (+0000) Subject: public JSDate(long) X-Git-Url: http://git.megacz.com/?p=org.ibex.js.git;a=commitdiff_plain;h=b60ef275929f083da04751e5f2974924d8a6389a public JSDate(long) darcs-hash:20040923070529-5007d-c6ab728ee1d0c4bcf53a749ab49209b615087337.gz --- diff --git a/src/org/ibex/js/JSDate.java b/src/org/ibex/js/JSDate.java index 694122c..68e893e 100644 --- a/src/org/ibex/js/JSDate.java +++ b/src/org/ibex/js/JSDate.java @@ -55,6 +55,16 @@ public class JSDate extends JS { } } + public JSDate(long now) { + if (thisTimeZone == null) { + // j.u.TimeZone is synchronized, so setting class statics from it + // should be OK. + thisTimeZone = java.util.TimeZone.getDefault(); + LocalTZA = thisTimeZone.getRawOffset(); + } + date = (double)now; + } + public String toString() { return date_format(date, FORMATSPEC_FULL); } public Object callMethod(Object method, Object a0, Object a1, Object a2, Object[] rest, int nargs) throws JSExn {