Hello, I'm attempting to find the difference between two dates, which (may) be in different timezones. One set of timezones will always be GMT; the others will vary. I simulate the problem in the following code:
diff is always 0, counterintuitively (at least to me).
What do I need to do to make this work?
Thanks
Code:
TimeZone t1 = TimeZone.getTimeZone("PDT");
TimeZone t2 = TimeZone.getTimeZone("GMT");
Calendar c1 = Calendar.getInstance(t1);
Calendar c2 = Calendar.getInstance(t2);
long diff = c1.getTimeInMillis() - c2.getTimeInMillis();
diff is always 0, counterintuitively (at least to me).
What do I need to do to make this work?
Thanks