[Solved] Simple way to convert “yyyyMMdd”-formatted string into a GregorianCalendar object

[ad_1]

You can use a SimpleDateFormat like so:

SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
Date date = format.parse("20150119");
Calendar calendar = GregorianCalendar.getInstance();
calendar.setTime(date);

[ad_2]

solved Simple way to convert “yyyyMMdd”-formatted string into a GregorianCalendar object