public JSDate(long)
[org.ibex.js.git] / 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 {