TimeFormat { static int parseUnixDate(CharSequence str, ParsePosition pos) throws ParseException { int yy = parseInt(str, 4, pos); parseCheck(str, '-', pos); int mm = parseInt(str, 2, pos); parseCheck(str, '-', pos); int dd = parseInt(str, 2, pos); long m = (mm + 9) % 12; long y = yy - m / 10; int days = (int) (365*y + y/4 - y/100 + y/400 + (m*306 + 5)/10 + (dd - 1)); return days - 719468; }  abstract StringBuilder format(long value, StringBuilder str); String format(long value); long parse(CharSequence str); abstract long parse(CharSequence str, ParsePosition pos); static TimeFormat getTimeFormat(TimeUnit unit, Epoch epoch);  }
@Test public void testParseUnixDate() throws ParseException { assertEquals(0, TimeFormat.parseUnixDate("1970-01-01", new ParsePosition(0))); }