Changing TimeZone for Calendar object doesnt change its time
Hy, I have a Calendar object with I have set with a Date but I I want from this calendar with the Date set, set other timezone for this calendar and get the corresponding time(always gettting the correct time if is in daylightsavings) but I get the same time.
Calendar calendario = Calendar.getInstance
calendario.setTime(new Date());
System.out.println(calendario.getTime()); *// for example I get the 14:12:25 hours for GMT+01:00*
calendario.setTimeZone(TimeZone.getTimeZone("GMT+02:00")); *//change time zone using GMT*
System.out.println(calendario.getTime()); *// I get the same hour: 14:12:25*
Why? How to do it using GMT format?
Thanks
Edited by: user13162080 on 13-sep-2011 14:31
Edited by: user13162080 on 13-sep-2011 14:48