Parse.com의 날짜 ( "Sat Mar 01 15:52:20 GMT + 1 : 00 2014"형식)를 시스템의 날짜 및 시간과 동일한 날짜 유형으로 지정하려면 어떻게해야하는지 묻고 싶습니다. 두 번째로 물어보고 싶은 것은 Parse.com에서 "month : day : hour : minute : year"를 얻는 방법입니다. 날짜가 위에 쓰여진 형식으로 주어 졌음에도 불구하고 말입니다.
제안 해 주셔서 감사합니다!
당신은 쉽게 날짜 형식 변환을 달성 할 수 있습니다 이렇게 시도합니다 ...
String inputPattern = "yyyy-MM-dd hh:mm:ss";
String outputPattern = "dd-MMM-yyyy hh:mm a";
SimpleDateFormat inFormat = new SimpleDateFormat(inputPattern);
SimpleDateFormat outputFormat = new SimpleDateFormat(outputPattern);
Date date1 = null;
if (date != null) {
try {
date1 = inFormat.parse(date);
str = outputFormat.format(date1);
Log.d(null, str);
} catch (ParseException e) {
e.printStackTrace();
}
} else {
str = " ";
}
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다