Development/Java
java - 현재 시간 확인
linuxism
2012. 7. 18. 20:24
간단한 현재시간 찍기
long startTime = System.currentTimeMillis();
System.out.println("Job 시작 시간 : "+ new Timestamp(startTime));
현재시간 가져오기 : SimpleDateFormat 이용
Calendar calendar = Calendar.getInstance();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmssSSS");
System.out.println("현재 시간 : " + dateFormat.format(calendar.getTime()));