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 getDateFromString(String strDate) {
        Calendar date = Calendar.getInstance();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy");
        try {
            date.setTime(simpleDateFormat.parse(strDate));
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return date;
    }
}