This post contains affiliate marketing, and I may receive a commission at no additional cost to you. 이 포스팅은 제휴마케팅이 포함되어 일정의 커미션을 지급받습니다.
반응형
String to Date, Date to String 형변환
String to Date
String from = "2019-03-01 12:12:12"; SimpleDateFormat transFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date to = transFormat.parse(from); |
Date to String
Date from = new Date(); SimpleDateFormat transFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String to = transFormat.format(from); |
반응형
'개발이야기 > Java' 카테고리의 다른 글
JAVA - 한글 인코딩 변환 체크 한방에 끝내기 (0) | 2019.03.22 |
---|---|
자바(JAVA) 형 변환(String과 int) (0) | 2019.03.22 |