Java tutorial
//package com.java2s; //License from project: LGPL import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.GregorianCalendar; public class Main { private static final SimpleDateFormat mFormat = new SimpleDateFormat("yyyy-MM-dd"); public static GregorianCalendar getGregorianCalendarFromEsmartString(String _esmart) { GregorianCalendar res = new GregorianCalendar(); res.setTime(getDateFromEsmartString(_esmart)); return res; } public static Date getDateFromEsmartString(String _esmart) { try { return mFormat.parse(_esmart); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); return null; } } }