How to compare time with correct PDT?

I want to compare the time as below, the two result time values are created by Calendar with setting timezone to “PST”. When I compare the two times, the result is always wrong.

Log time: Tue Oct 06 17:21:17 PDT 1970, while action time: Mon Oct 06 17:49:47 PDT 2014

Code is like below:

Calendar calendar = Calendar.getInstance();
DateFormat df = new SimpleDateFormat("MM-dd HH:mm:ss.SSS");
df.setTimeZone(TimeZone.getTimeZone("PST"));
s = newLine.substring(0, 17);
calendar.setTime(df.parse(s));


Download how.to.compare.time.with.correct.pdt.zip
Direct Link


Download


Download how.to.compare.time.with.correct.pdt.zip
Mediafire


Download


Download how.to.compare.time.with.correct.pdt.zip
4Upfiles


Download


Download how.to.compare.time.with.correct.pdt.zip
Zippyshare


Download


Download how.to.compare.time.with.correct.pdt.zip
Google Drive


Download

Both comments and pings are currently closed.

Comments are closed.