public void test_Date_setDay() { Date date = new Date(2005, 2, 12, 12, 15, 45, 1, 2, 0); assertTrue(date != null); int i = date.setDay(29); assertTrue(i == libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE); assertTrue(date.getDay() == 1); i = date.setDay(31); assertTrue(i == libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE); assertTrue(date.getDay() == 1); i = date.setDay(15); assertTrue(i == libsbml.LIBSBML_OPERATION_SUCCESS); assertTrue(date.getDay() == 15); assertTrue(date.getDateAsString().equals("2005-02-15T12:15:45+02:00")); date = null; }
// default constructor - default date and time public DateAndTime() { date.setMonth(1); date.setDay(1); date.setYear(1900); time.setHour(0); time.setMinute(0); time.setSecond(0); System.out.printf("DateAndTime default constructor : %s\n", this); }
// constructor with both date and time specified public DateAndTime(int month, int day, int year, int hour, int min, int sec) { date.setMonth(month); date.setDay(day); date.setYear(year); time.setHour(hour); time.setMinute(min); time.setSecond(sec); System.out.printf("DateAndTime time custom values constructor : %s\n", this); }
public Date(int m, int d, int y) { setMonth(m); setDay(d); setYear(y); }