티스토리 뷰

JAVA

SimpleDateFormat 으로 String -> Date, Date -> String 변환

드미트리우스 존슨 2017. 11. 12. 23:33

String dtString = "12 12 2012";

SimpleDateFormat transFormat = new SimpleDateFormat("dd MM yyyy", Locale.ENGLISH);

Date to = transFormat.parse(dtString);


SimpleDateFormat transFormat2 = new SimpleDateFormat("yyyy-MM-dd");


String to2 = transFormat2.format(to);

'JAVA' 카테고리의 다른 글

Collector 를 사용하여 groupingBy 하기  (0) 2017.11.22
Array to ArrayList  (0) 2017.11.07
리눅스에 자바 설치  (0) 2017.11.06
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
more
«   2025/05   »
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
글 보관함