Code example for Date

Methods: setDate, setHours, setMinutes, setMonth, setSeconds, setYear

0
    assertEquals(06, date.getMinutes());
    assertEquals(18, date.getSeconds());
  }   
   
  public void testParseDateToString() { 
    Date date = new Date();
    date.setYear(110);
    date.setMonth(04);
    date.setDate(20);
    date.setHours(10);
    date.setMinutes(25);
    date.setSeconds(30);
     
    String expectedDateString = "2010-05-20T10:25:30+03:00"; // +xx:xx depends on timezone
     
    String parsedDateString = Util.formatDateToString(date); 
     
    Log.d("UtilTest", "************");
    Log.d("UtilTest", "expectedDateString" + expectedDateString);
    Log.d("UtilTest", "parsedDateString" + parsedDateString);
    Log.d("UtilTest", "************");