Notice
Recent Posts
Recent Comments
Link
«   2025/03   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
Tags
more
Archives
Today
Total
관리 메뉴

WON.dev

chapter11 : Calendar_Date 본문

JAVA/chapter20_api

chapter11 : Calendar_Date

GAWON 2023. 5. 30. 18:25
package org.joonzis.ex;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Ex11_Calendar_Date {
	public static void main(String[] args) {
		
		Calendar cal = Calendar.getInstance();
		
		// Calendar 객체를 이용하여 현재 날짜 가져오기(Date 객체 생성)
		Date now = cal.getTime();

		SimpleDateFormat sdf = new SimpleDateFormat("a hh시 mm분 ss초");
		
		String today = sdf.format(now);
		
		System.out.println(today);
		
		
		
	}
}

'JAVA > chapter20_api' 카테고리의 다른 글

Test . api  (0) 2023.05.30
chapter12 : Dday  (0) 2023.05.30
chapter10 : Date_SimpleDateFormat  (0) 2023.05.30
chapter09 : Calendar  (0) 2023.05.30
chapter08 : Big_number  (0) 2023.05.30