I developed an application , in that i need to save the the event date and time. By default the time and date are in "America/Chicago" timezone format. Now, i need to convert them into user's device Time Zone format. but i got wrong format.
I did the following.
SimpleDateFormat curFormater1=new SimpleDateFormat("MM-dd-yyyy-hh:mm a");//10-23-2012-08:30 am
curFormater1.setTimeZone(TimeZone.getTimeZone("America/Chicago"));
curFormater1.setTimeZone(TimeZone.getDefault());
current output: TimeZone.getTimeZone("America/Chicago") is 10-22-2012-10:00 PM TimeZone.getDefault() is 10-23-2012-08:30 AM
Required output TimeZone.getTimeZone("America/Chicago") is 10-23-2012-08:30 AM TimeZone.getDefault() is 10-23-2012-07:00 PM