Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    public static Calendar parseDate(String date, String format) throws ParseException {
        Calendar lCalendar = Calendar.getInstance();
        SimpleDateFormat formatter = new SimpleDateFormat(format);
        lCalendar.setTime(formatter.parse(date));
        return lCalendar;
    }
}