@@ -0,0 +1,781 @@
+import java.text.FieldPosition;%0Aimport java.text.SimpleDateFormat;%0Aimport java.util.Date;%0A%0Apublic class Dates %7B%0A  private final static long EPOCH = 1234567890;%0A  private final static String TEXT = %222009-02-13T23:31:30%22;%0A%0A  private static void expect(boolean v) %7B%0A    if (! v) throw new RuntimeException();%0A  %7D%0A%0A  public static void main(String%5B%5D args) throws Exception %7B%0A    SimpleDateFormat format = new SimpleDateFormat(%22yyyy-MM-dd'T'HH:mm:ss%22);%0A    Date date = format.parse(%221970-01-01T00:00:00%22);%0A    expect(0 == date.getTime());%0A%0A    date = new Date(EPOCH * 1000l);%0A    String actual = format.format(date, new StringBuffer(), new FieldPosition(0)).toString();%0A    expect(TEXT.equals(actual));%0A%0A    date = format.parse(TEXT);%0A    expect(EPOCH == date.getTime() / 1000l);%0A  %7D%0A%7D%0A

Test date parsing/formatting