저는 홍콩에 있습니다. 어떻게하면 미국에서 년, 월, 일을 얻을 수 있습니까 ??다른 시간대에서 년, 월, 일을 얻는 방법?
Calendar calendar = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy hh:mm:ss z");
sdf.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles"));
sdf.format(calendar.getTime());
하지만 한 달, 한 해 얻을하는 방법을 알고하지 않습니다
는 내가 노력했다.
SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy hh:mm:ss z");
sdf.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles"));
String usaDateStr= sdf.format(dateObj);
이 example 참조 : 당신은 다음과 같은 것을 할 필요가
미안 날짜가 17 반환하지만 16 – jjLin
편집해야합니다. 연도는 LATime에서 가져와야합니다. – jjLin
오른쪽! 고마워. – DNax