반응형
Date → String
SimpleDateFormat dateType = new SimpleDateFormat("yyyyMMddHHmmss");
String testDateString = dateType.format(new Date());
String → Date
SimpleDateFormat dateType = new SimpleDateFormat("yyyyMMddHHmmss");
String testDateString = dateType.format(new Date());//Result : 20200619144500
Date testDate = dateType.parse(dateString);
반응형
'→ 개발 > JAVA' 카테고리의 다른 글
[JAVA] byte[] → HexString (0) | 2020.05.28 |
---|---|
[JAVA] int, long, short GetBytes() (0) | 2020.04.29 |
[JAVA] String GetBytes (0) | 2020.04.29 |
[JAVA] C# string.PadLeft() → JAVA String.format... (0) | 2020.04.23 |
[JAVA] C# Buffer.BlockCopy() → JAVA System.arraycopy() (0) | 2020.04.23 |