I need to change this format to Date
Fri Oct 28 05:47:54 SGT 2011
I not sure the SGT how to set?
You can find all patterns in the SimpleDateFormat javadoc. SGT is a general time zone and it's listed as z. So, the pattern should look like:
EEE MMM dd HH:mm:ss z yyyy
The month names seems to be English, so this should do in combination with Locale.ENGLISH:
SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", Locale.ENGLISH);
Date date = sdf.parse(string);
// ...
Interesting enough, that's also basically the default pattern of the Date#toString() method (which you would see when you're doing a System.out.println(date), for example).