1. 程式人生 > >Date與Calender轉化設置日期時間Demo

Date與Calender轉化設置日期時間Demo

ret instance stat dem pre gettime int tin day

public static Date removeTime(Date date) {    
        Calendar cal = Calendar.getInstance();  
        cal.setTime(date);
        int year = cal.get(Calneder.YEAR);  
        cal.set(Calendar.HOUR_OF_DAY, 0);  
        return cal.getTime(); 
}

Date與Calender轉化設置日期時間Demo