Over a million developers have joined DZone.

How To Get A String With Just The Date From A Calendar

·
// Given Calendar cal


String date = cal.get(Calendar.DAY_OF_MONTH) + "-" 
    + cal.get(Calendar.MONTH) + "-" + cal.get(Calendar.YEAR);
Topics:

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

{{ parent.tldr }}

{{ parent.urlSource.name }}