JAVA/자바
자바 데이터 - 스트링 변환
왕왕왕왕
2016. 4. 26. 15:30
public class Test { public class Test { public static void main(String[] args) throws ParseException { SimpleDateFormat SDformat = new SimpleDateFormat("yyyy-MM-dd"); //표시 형식 String now ="2014-11-19"; //시스템의 현재 날짜 저장 Date transdate = SDformat.parse(now); //날짜 타입으로 변환 System.out.println("\t 날짜 형태 : "+transdate ); //출력 String transStr = SDformat.format(date); //스트링 타입으로 변환 System.out.println("\t 스트링 형태 : "+transStr); //출력 } }