assertEquals("-04:00", fdf.format(millis2));
    public void testFormat() {        Locale realDefaultLocale = Locale.getDefault();        TimeZone realDefaultZone = TimeZone.getDefault();        try {            Locale.setDefault(Locale.US);            TimeZone.setDefault(TimeZone.getTimeZone("America/New_York"));            FastDateFormat fdf = null;            SimpleDateFormat sdf = null;            GregorianCalendar cal1 = new GregorianCalendar(2003, 0, 10, 15, 33, 20);            GregorianCalendar cal2 = new GregorianCalendar(2003, 6, 10, 9, 00, 00);            Date date1 = cal1.getTime();            Date date2 = cal2.getTime();            fdf = FastDateFormat.getInstance("yyyy-MM-dd'T'HH:mm:ss");            sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");            assertEquals(sdf.format(date1), fdf.format(date1));            assertEquals("2003-01-10T15:33:20", fdf.format(date1));            assertEquals("2003-01-10T15:33:20", fdf.format(cal1));            assertEquals("2003-07-10T09:00:00", fdf.format(date2));            assertEquals("2003-07-10T09:00:00", fdf.format(cal2));            fdf = FastDateFormat.getInstance("Z");            assertEquals("-0500", fdf.format(date1));            assertEquals("-0500", fdf.format(cal1));            fdf = FastDateFormat.getInstance("Z");            assertEquals("-0400", fdf.format(date2));            assertEquals("-0400", fdf.format(cal2));            fdf = FastDateFormat.getInstance("ZZ");            assertEquals("-05:00", fdf.format(date1));            assertEquals("-05:00", fdf.format(cal1));            fdf = FastDateFormat.getInstance("ZZ");            assertEquals("-04:00", fdf.format(date2));            assertEquals("-04:00", fdf.format(cal2));            String pattern = "GGGG GGG GG G yyyy yyy yy y MMMM MMM MM M" +                " dddd ddd dd d DDDD DDD DD D EEEE EEE EE E aaaa aaa aa a zzzz zzz zz z";            fdf = FastDateFormat.getInstance(pattern);            sdf = new SimpleDateFormat(pattern);            assertEquals(sdf.format(date1), fdf.format(date1));            assertEquals(sdf.format(date2), fdf.format(date2));        } finally {            Locale.setDefault(realDefaultLocale);            TimeZone.setDefault(realDefaultZone);        }    }