Java
[Java] Date 객체 활용한 현재시간 가져오기
IT공부블로그
2020. 4. 1. 18:33
728x90
반응형
12345678 public String getCurrentTime() {//HH:mm:ss -> 0~24시 hh:mm:ss -> 0~12시//yyyy-MM-dd HH:mm:ssSimpleDateFormat formatter = new SimpleDateFormat ("HH:mm:ss");Date date = new Date();String time = formatter.format(date);return time;}cs
728x90
반응형