APISonar


oracle.sql.DATE.DATE

> oracle > sql > DATE > DATE
oracle APIs sql APIs DATE APIs DATE APIs

Example 1
public void test_0 () throws Exception {
        Timestamp date = new Timestamp(System.currentTimeMillis());
        DATE timestamp = new DATE(date);
        
        String text = JSON.toJSONString(timestamp);
        Assert.assertEquals((date.getTime() / 1000) * 1000, Long.parseLong(text));
    }
Example 2
public void testLocalDateConverter() throws ConverterException {
        LocalDate lc = LocalDate.now();

        DATE oracleDate = new DATE(new java.sql.Date(lc.toDateTimeAtStartOfDay().getMillis()));

        LocalDate convertedDate = Convert.getConverterIfExists(LocalDate.class).convert(oracleDate);

        assertEquals(lc, convertedDate);
    }