Code example for SimpleTimeZone

0
    static final String TYPE_BASE64 = "base64";
    static final String TYPE_ARRAY = "array";
    static final String TYPE_STRUCT = "struct";
 
    static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss");
    static Calendar cal = Calendar.getInstance(new SimpleTimeZone(0, "GMT"));
 
    @SuppressWarnings("unchecked") 
    static void serialize(XmlSerializer serializer, Object object) throws IOException {
        if (object == null)
            return; 
 
        // check for scalar types: 
        if (object instanceof Integer || object instanceof Short || object instanceof Byte) {
            serializer.startTag(null, TYPE_I4).text(object.toString()).endTag(null, TYPE_I4);
        } else 
        if (object instanceof Long) {
            serializer.startTag(null, TYPE_I8).text(object.toString()).endTag(null, TYPE_I8);
        } else 
        if (object instanceof Double || object instanceof Float) {
            serializer.startTag(null, TYPE_DOUBLE).text(object.toString()).endTag(null, TYPE_DOUBLE);