I am trying to get a calendar object with the a specific time tomorrow in a specific time zone (not the time zone the device is in). In the example below I want to get 12:15am in Central time zone tomorrow not matter where in the world the device is located.
First question, is this the best way to do this?
Second question, how should I deal with daylight savings. I am only dealing with the 4 continental US time zones and I can assume that I want to adjust for daylight savings time.
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT"), Locale.getDefault());
calendar.add(Calendar.DATE, 1);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.add(Calendar.HOUR_OF_DAY, 6); //Central time zone
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
calendar.add(Calendar.MINUTE, 15);
The best way to do this is to use JodaTime, but I see that you have put android tag, so Calendar is probably your only option.
For a second question. java.util.Calendar handles Daylight to Standard time conversion.