Java Data Type How to - SimpleDateFormat format: EEE, dd MMM yyyy HH:mm:ss z


We would like to know how to simpleDateFormat format: EEE, dd MMM yyyy HH:mm:ss z.


import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
//w w w .  j  a v a2 s.c o  m
public class Main {
    public static SimpleDateFormat postedformat = 
        new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z");
    public static void main(String[] args) {
        try {
            Date newDate = postedformat.parse("Wed, 30 Jun 2010 15:07:06 CST");
            System.out.println("Date: " + newDate);
        } catch (ParseException e) {

The code above generates the following result.