Code example for Timestamp

Methods: getTimetoString

0
        cal3.set(Calendar.MINUTE, 11);
        cal3.set(Calendar.SECOND, 55);
        cal3.set(Calendar.MILLISECOND, 0);
 
        millis = cal3.getTime().getTime();
        Timestamp t3 = new Timestamp(millis);
        times.add(t3);
        // TIMESTAMP value 
        int i = 17;
 
        Timestamp timeRes = res.getTimestamp(i);
        assertEquals(t2.toString(), timeRes.toString());
        assertEquals(t2.getTime(), timeRes.getTime());
        assertEquals(t2, timeRes);
        // DATE value 
        i = 18;
        timeRes = res.getTimestamp(i);
        assertEquals(t3.toString(), timeRes.toString());
        assertEquals(t3.getTime(), timeRes.getTime());
        assertEquals(t3, timeRes);
 
        res.next();
        assertNull(res.getTime(i));
 
        try { 
Stop searching for code, let great code find you!  Add Codota to your java IDE