Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

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) {
            e.printStackTrace();
        }
    }
}