====== Java SimpleDateFormat ====== * description : Java SimpleDateFormat * author : 오션 * email : shlim@repia.com * lastupdate : 2022-06-21 Tue \\ ====== Java SimpleDateFormat ====== SimpleDateFormat 클래스는 데이터를 형식화하고 분석하는데에 도움이 됩니다. 날짜를 한 형식에서 다른 형식으로 변경할 수 있습니다.\\ 사용자가 문자열 날짜 형식을 Date 객체로 해석할 수 있도록 합니다. 원하는 대로 날짜를 수정할 수 있습니다.\\ \\ ==== Constructors: ==== === SimpleDateFormat(String pattern_arg) :=== Constructs a Simple Date Format using the given pattern – pattern_arg, default date format symbols for the default FORMAT locale.\\ import java.text.SimpleDateFormat; import java.util.Calendar; public class NewClass { public static void main(String[] args) { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); // Creating instance of the System date Calendar cal = Calendar.getInstance(); System.out.println("The Present Date is " + cal.getTime()); // The Present Date is Tue Jun 21 20:23:31 KST 2022 // Formatting Date according "yy-MM-dd" String formattedDate = dateFormat.format(cal.getTime()); System.out.println("The Formatted Date is " + formattedDate); // The Formatted Date is 2022-06-21 } } ==== Ref LInk ==== [[https://www.geeksforgeeks.org/java-simpledateformat-set-1/?ref=gcse|Java SimpleDateFormat-Set 1]]\\ \\ {{tag> 오션, SimpleDateFormat}}