import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;

public class Main {
	public static void main(String[] args) throws ParseException {
		String strDateTime = "31 October 2011 11:19:56 GMT";

		SimpleDateFormat sdf = new SimpleDateFormat("dd MMMM yyyy HH:mm:ss z", Locale.ENGLISH);
		sdf.setTimeZone(TimeZone.getTimeZone("GMT"));

		Date date = sdf.parse(strDateTime);

		String strDate = sdf.format(date);
		System.out.println(strDate);

		// Some other format
		sdf = new SimpleDateFormat("MMMM dd HH:mm:ss z yyyy", Locale.ENGLISH);
		sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
		strDate = sdf.format(date);
		System.out.println(strDate);

		// The last format with some other timezone
		sdf.setTimeZone(TimeZone.getTimeZone("America/New_York"));
		strDate = sdf.format(date);
		System.out.println(strDate);
	}
}