public static String convertDateToString(Date date) {
if(date == null) return null;
SimpleDateFormat formatter = new SimpleDateFormat("yyyy년 M월 d일, h시 m분 s초");
return formatter.format(date);
}
public static String convertDateToYear(Date date) {
if(date == null) return null;
SimpleDateFormat formatter = new SimpleDateFormat("yyyy");
return formatter.format(date);
}
public static String convertDateToMonth(Date date) {
if(date == null) return null;
SimpleDateFormat formatter = new SimpleDateFormat("MM");
return formatter.format(date);
}
public static String convertDateToDay(Date date) {
if(date == null) return null;
SimpleDateFormat formatter = new SimpleDateFormat("dd");
return formatter.format(date);
}