Am trying convert date which is in local time zone to GMT, i did some thing like this
SimpleDateFormat sdf = new SimpleDateFormat(\"MM/dd/yyyy HH:mm:ss\");
You can do this using this function say you want to convert local time to GMT time and also this will be GMT+6 or GMT+5 then just use this function. This function will return answer.
public String getCurrentDate() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy MM dd hh:mm a zzz");
Date date = new Date();
sdf.setTimeZone(TimeZone.getTimeZone("GMT+6:00"));
return sdf.format(date);
}