Here you can find the source of convertDate(Object obj)
private static Date convertDate(Object obj)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { private static Date convertDate(Object obj) { if (obj != null) { if (obj instanceof Calendar) { Calendar cal = (Calendar) obj; return cal.getTime(); }/*from w w w. j av a2 s. com*/ if (obj instanceof Date) { return (Date) obj; } } return null; } }