DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

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

05.08.2007
| 4209 views |
  • submit to reddit
        // Given Calendar cal

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