import java.util.*;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
public class DateTest {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Date d = new Date();
System.out.println(d);
//SimpleDateFormat sd = new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss E”);
SimpleDateFormat sd = new SimpleDateFormat(“yyyy년 MM월 dd일 HH시 mm분 ss초 E요일”);
System.out.println(sd.format(d));
Timestamp ts = new Timestamp(System.currentTimeMillis());
System.out.println(ts);
SimpleDateFormat sd2 = new SimpleDateFormat(“yyyy년 MM월 dd일 HH시 mm분 ss초 E요일”);
System.out.println(sd2.format(ts));
Calendar cal = Calendar.getInstance();
Calendar cal01 = new GregorianCalendar(); //업케스트
//cal.YEAR;
//Calendar.YEAR;
System.out.println(cal.get(Calendar.YEAR));
System.out.println(cal.get(Calendar.MONTH)+1);
System.out.println(cal.get(Calendar.DATE));
System.out.println(cal.get(Calendar.HOUR));
System.out.println(cal.get(Calendar.MINUTE));
System.out.println(cal.get(Calendar.SECOND));
String a[] = {“일”, “월”, “화”, “수”, “목”, “금”, “토”};
int w = cal.get(Calendar.DAY_OF_WEEK);
System.out.println(a[w-1]);
}
}