Search in sources :

Example 1 with TypeUtils.castToDate

use of com.alibaba.fastjson.util.TypeUtils.castToDate in project fastjson by alibaba.

the class DefaultExtJSONParserTest method testCastCalendar.

public void testCastCalendar() throws Exception {
    Calendar c = Calendar.getInstance();
    Date d = TypeUtils.castToDate(c);
    Assert.assertEquals(c.getTime(), d);
}
Also used : Calendar(java.util.Calendar) Date(java.util.Date) TypeUtils.castToDate(com.alibaba.fastjson.util.TypeUtils.castToDate)

Aggregations

TypeUtils.castToDate (com.alibaba.fastjson.util.TypeUtils.castToDate)1 Calendar (java.util.Calendar)1 Date (java.util.Date)1