public JSDate(long)
authoradam <adam@megacz.com>
Thu, 23 Sep 2004 07:05:29 +0000 (07:05 +0000)
committeradam <adam@megacz.com>
Thu, 23 Sep 2004 07:05:29 +0000 (07:05 +0000)
darcs-hash:20040923070529-5007d-c6ab728ee1d0c4bcf53a749ab49209b615087337.gz

src/org/ibex/js/JSDate.java

index 694122c..68e893e 100644 (file)
@@ -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 {