I am trying to write an app that will display the current time in the devices default timezone, and then display the time in different time zones, namely the current time in Kabul, Afghanistan where a good friend is stationed in the Army. Here is what I have thus far in my java code:
Date dateLocal = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("HH:MM a");
String local = sdf.format(dateLocal);
Date dateKabul = new Date();
TextView localTime = (TextView) rootView.findViewById(R.id.textView);
localTime.setText(local);
This will display the current device time just fine, although I might want standard time not military time. I need to find a way to display the different time zones using this general setup. The time zone I am looking to show is 8.5 hours ahead of EST. Any idea how I might be able to do this?