I\'m using DatePicker in my Android Application to display available dates that the user can pick. I want to display the dates in the GMT Time Zone so that all users see the
public void GetDate(final String flag) {
final Calendar c = Calendar.getInstance();
c.setTimeZone(TimeZone.getTimeZone("Australia/Canberra"));// here is your code
mYear = c.get(Calendar.YEAR);
mMonth = c.get(Calendar.MONTH);
mDay = c.get(Calendar.DAY_OF_MONTH);
DatePickerDialog datePickerDialog = new DatePickerDialog(this,
new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year,
int monthOfYear, int dayOfMonth) {
userentered_Date = dayOfMonth + "-" + (monthOfYear + 1) + "-" + year;
Date date = new GregorianCalendar(year, monthOfYear, dayOfMonth).getTime();
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
DateFormat sdf = new SimpleDateFormat("dd MMMM yyyy");
String strDate = df.format(date);
String e = sdf.format(date);
GetTime(strDate, e, flag);
}
}, mYear, mMonth, mDay);
datePickerDialog.show();
}
This should get you working.