Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

How To Convert A String With A Date To A Calendar

DZone's Guide to

How To Convert A String With A Date To A Calendar

·
Free Resource

SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
Date date = sdf.parse(strDate);
Calendar cal = Calendar.getInstance();
cal.setTime(date);
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}