setHour() 공개 메소드

public setHour ( long hour ) : int
hour long
리턴 int
예제 #1
0
 public void test_Date_setters()
 {
     Date date = new  Date(2005,12,30,12,15,45,1,2,0);
       assertTrue( date != null );
       date.setYear(2012);
       date.setMonth(3);
       date.setDay(28);
       date.setHour(23);
       date.setMinute(4);
       date.setSecond(32);
       date.setSignOffset(1);
       date.setHoursOffset(2);
       date.setMinutesOffset(32);
       assertTrue( date.getYear() == 2012 );
       assertTrue( date.getMonth() == 3 );
       assertTrue( date.getDay() == 28 );
       assertTrue( date.getHour() == 23 );
       assertTrue( date.getMinute() == 4 );
       assertTrue( date.getSecond() == 32 );
       assertTrue( date.getSignOffset() == 1 );
       assertTrue( date.getHoursOffset() == 2 );
       assertTrue( date.getMinutesOffset() == 32 );
       assertTrue((  "2012-03-28T23:04:32+02:32" == date.getDateAsString() ));
       date = null;
 }
예제 #2
0
 public void test_Date_getDateAsString()
 {
     string dd =  "2005-02-02T14:56:11Z";
       Date date = new  Date(dd);
       assertTrue( date != null );
       assertTrue( date.getYear() == 2005 );
       assertTrue( date.getMonth() == 2 );
       assertTrue( date.getDay() == 2 );
       assertTrue( date.getHour() == 14 );
       assertTrue( date.getMinute() == 56 );
       assertTrue( date.getSecond() == 11 );
       assertTrue( date.getSignOffset() == 0 );
       assertTrue( date.getHoursOffset() == 0 );
       assertTrue( date.getMinutesOffset() == 0 );
       date.setYear(2012);
       date.setMonth(3);
       date.setDay(28);
       date.setHour(23);
       date.setMinute(4);
       date.setSecond(32);
       date.setSignOffset(1);
       date.setHoursOffset(2);
       date.setMinutesOffset(32);
       assertTrue((  "2012-03-28T23:04:32+02:32" == date.getDateAsString() ));
       date = null;
 }
예제 #3
0
 public void test_Date_setHour()
 {
     Date date = new  Date(2005,12,30,12,15,45,1,2,0);
       assertTrue( date != null );
       int i = date.setHour(434);
       assertTrue( i == libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE );
       assertTrue( date.getHour() == 0 );
       i = date.setHour(12121);
       assertTrue( i == libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE );
       assertTrue( date.getHour() == 0 );
       i = date.setHour(9);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( date.getHour() == 9 );
       assertTrue((                             "2005-12-30T09:15:45+02:00" == date.getDateAsString() ));
       date = null;
 }