@Test public void testParseDay() throws ParseException { GregorianCalendar gc = new GregorianCalendar(2001, 12, 31); SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy"); Date reference = format.parse("31/12/2001"); if (reference.equals(gc.getTime())) { Day d = Day.parseDay("31/12/2001"); assertEquals(37256, d.getSerialDate().toSerial()); } Day d = Day.parseDay("2001-12-31"); assertEquals(37256, d.getSerialDate().toSerial()); }
public static Day parseDay(String s) { try { return new Day (Day.DATE_FORMAT.parse(s)); } catch (ParseException e1) { try { return new Day (Day.DATE_FORMAT_SHORT.parse(s)); } catch (ParseException e2) { } } return null; }
Day extends RegularTimePeriod implements Serializable { public static Day parseDay(String s) { try { return new Day (Day.DATE_FORMAT.parse(s)); } catch (ParseException e1) { try { return new Day (Day.DATE_FORMAT_SHORT.parse(s)); } catch (ParseException e2) { } } return null; } }
Day extends RegularTimePeriod implements Serializable { public static Day parseDay(String s) { try { return new Day (Day.DATE_FORMAT.parse(s)); } catch (ParseException e1) { try { return new Day (Day.DATE_FORMAT_SHORT.parse(s)); } catch (ParseException e2) { } } return null; } Day();  Day(int day, int month, int year);  Day(SerialDate serialDate);  Day(Date time);  Day(Date time, TimeZone zone, Locale locale); }
Day extends RegularTimePeriod implements Serializable { public static Day parseDay(String s) { try { return new Day (Day.DATE_FORMAT.parse(s)); } catch (ParseException e1) { try { return new Day (Day.DATE_FORMAT_SHORT.parse(s)); } catch (ParseException e2) { } } return null; } Day();  Day(int day, int month, int year);  Day(SerialDate serialDate);  Day(Date time);  Day(Date time, TimeZone zone, Locale locale); SerialDate getSerialDate(); int getYear(); int getMonth(); int getDayOfMonth(); @Override long getFirstMillisecond(); @Override long getLastMillisecond(); @Override void peg(Calendar calendar); @Override RegularTimePeriod previous(); @Override RegularTimePeriod next(); @Override long getSerialIndex(); @Override long getFirstMillisecond(Calendar calendar); @Override long getLastMillisecond(Calendar calendar); @Override boolean equals(Object obj); @Override int hashCode(); @Override int compareTo(TimePeriod o1); @Override String toString(); static Day parseDay(String s); }
Day extends RegularTimePeriod implements Serializable { public static Day parseDay(String s) { try { return new Day (Day.DATE_FORMAT.parse(s)); } catch (ParseException e1) { try { return new Day (Day.DATE_FORMAT_SHORT.parse(s)); } catch (ParseException e2) { } } return null; } Day();  Day(int day, int month, int year);  Day(SerialDate serialDate);  Day(Date time);  Day(Date time, TimeZone zone, Locale locale); SerialDate getSerialDate(); int getYear(); int getMonth(); int getDayOfMonth(); @Override long getFirstMillisecond(); @Override long getLastMillisecond(); @Override void peg(Calendar calendar); @Override RegularTimePeriod previous(); @Override RegularTimePeriod next(); @Override long getSerialIndex(); @Override long getFirstMillisecond(Calendar calendar); @Override long getLastMillisecond(Calendar calendar); @Override boolean equals(Object obj); @Override int hashCode(); @Override int compareTo(TimePeriod o1); @Override String toString(); static Day parseDay(String s);  }