Android 가 현재 시간의 android.text.format.Time 을 가 져 오 는 데 시간 이 지 났 습 니 다.

전에 사 용 했 어
Time time = new android.text.format.Time();
time.setToNow();
String timeNow = time.format("%Y%m%d%H%M%S");

현재 시간 을 가 져 옵 니 다.하지만 android 22 에서 시간 이 지난 deprecated 를 알려 줍 니 다.
그리고 찾 아 보 니 어느 것 을 써 야 좋 을 지 모 르 겠 어 요.이것 을 시험 해 볼 수 밖 에 없 었 어 요.
Calendar calendar = Calendar.getInstance();
String timeNow = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(calendar.getTime());

다행히 당분간 문 제 를 발견 하지 못 했다.
그런데 방금 글 을 봤 어 요.
http://tangmingjie2009.iteye.com/blog/1543166
이 방법 이 가장 느리다 고 합 니 다.가장 빠 른 것 은...
System.currentTimeMillis()

과연 그 럴 까?하기 귀찮다

좋은 웹페이지 즐겨찾기