파일의 Lastmodified Time과 현재 파일이있는 FTP 서버의 현재 시간 사이의 시간차를 계산해야한다는 요구 사항이 있습니다.Java의 시차 계산
abc.txt라는 파일 (최종 수정일 : 2014 년 7 월 23 일 1:00:00 AM)이 미국 FTP 서버에 있습니다. 내가 미국 FTP 서버 (T2)의 파일 & currentTime을 마지막으로 수정 한 타임 스탬프 (T1)을 얻을 두 시간 사이 분의 차이를 계산해야합니다 (D1을 D2)
다음내가 너무 가지고 무엇을 멀리.
Calendar zonedate = Calendar.getInstance();
DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
formatter.setTimeZone(TimeZone.getTimeZone("MST"));
System.out.println("PDT :: "+ formatter.format(zonedate.getTime()));
String d1 = formatter.format(zonedate.getTime());
System.out.println(d1);
Date d2 = formatter.parse(d1);
System.out.println(d2);
그렇다면 어떤 부분을 할 수 없습니까? –
그래서 문제가 무엇입니까? –
이 질문은 수많은 질문을 받았습니다. 간단한 구글은 많은 해답을 발견 할 것이다. –