if (o instanceof NSTimestamp) {
time = ((NSTimestamp) o).getTime();
tz = ((NSTimestamp) o).timeZone().getID();
}
else {
throw new MarshallException("cannot marshall date using class " + o.getClass());
}
JSONObject obj = new JSONObject();
if (ser.getMarshallClassHints()) {
obj.put("javaClass", o.getClass().getName());
}
obj.put("time", time);
obj.put("tz", tz);
return obj;
}
catch (JSONException e) {
throw new MarshallException("Failed to marshall NSTimestamp.", e);
}
}