Java/Java
Java 17. String.format & SimpleDateFormat
shin96bc
2022. 5. 24. 14:43
(1) SimpleDateFormat
1) Java 에서 현재 시각이나 어떤 시각을 특정 형식에 맞추어 출력할 때 사용한다.
2) 사용법
<1> 표현식 1 (날짜 & 시간)
<2> 표현식 2 (날짜 & 시간 & 지역)
<3> 태그 종류
(2) String.format
1) 필수 값
2) 문법
3) 옵션
4) 지역도 설정 가능
<1> String str = String.format(Locale.US, "%05d/%05d", 1, 1);
참고자료:
https://shyunku.tistory.com/33
https://interconnection.tistory.com/116