DateTest.java Source code

Java tutorial

Introduction

Here is the source code for DateTest.java

Source

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

public class DateTest {
    public static void main(String[] args) throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy, MM, dd");
        Date date = sdf.parse("2009, 12, 9");
        System.out.println(date);
    }
}