JAVA 1000분의 1초까지 나타내기
public static String getTimeStamp() {
String rtnStr = null;
//문자열로 변환하기 위한 패턴 설정
//(년도-월-일 시:분:초:초 (자정이후 초))
String pattern = "YYYYMMddhhmmssSSS";
try {
SimpleDateFormat sdfCurrent = new SimpleDateFormat(patten, Locale.KOREA);
Timestamp ts = new Timestamp(System.currentTimeMillis());
rtnStr = sdfCurrent.format(ts.getTime());
}catch (Exception e){
e.printStackTrace();
}
return rtnStr;
}
'JAVA' 카테고리의 다른 글
[JAVA] class path에서 resource 찾기 (0) | 2017.10.30 |
---|---|
[JAVA] cache function (0) | 2017.10.27 |
[JAVA] BigInteger형을 바이트 배열로!! (0) | 2017.10.27 |
[JAVA] application att (0) | 2017.10.27 |
[JAVA] AES 대칭키 암복호화 (0) | 2017.10.27 |