How can I utilize SimpleDateFormat with Calendar? Code Answer

I’ve got GregorianCalendar instances and need to use SimpleDateFormat (or maybe something that can be used with calendar but that provides required #fromat() feature) to get needed output. Please, suggest work arounds as good as permanent solutions.


Try this:

Calendar cal = new GregorianCalendar();
SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");

Related Posts

© No Copyrights, All Questions are retrived from public domain.
Tutorial Guruji