Hi all,
i create a calendar object for the given time zone say "HongKong" but when i try to read the time from the calendar object it returns the time in the mylocal time zone.This thing is strange to me why calendar object to to behave like this.if i want to get the time in the time zone of the calendar object what should i do i am not getting the idea any where or doing thing i want.
<code>
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.SimpleTimeZone;
import java.util.TimeZone;
/**
* @author Vijay Shanker
*
*/
public class CalendarConditions {
public static void main(
String[] args) {
CalendarConditions conditions = new CalendarConditions();
conditions.createDateFromCalendar();
}
public void createDateFromCalendar() {
Calendar cal = new GregorianCalendar(TimeZone.getTimeZone("Hongkong"));
System.out.println(cal.getTime());
}
}
</code>