java - How can I utilize SimpleDateFormat with Calendar? -
i've got gregoriancalendar instances , need use simpledateformat (or maybe can used calendar provides required #fromat() feature) needed output. please, suggest work arounds permanent solutions. try this: calendar cal = new gregoriancalendar(); simpledateformat dateformat = new simpledateformat("dd-mm-yyyy"); dateformat.settimezone(cal.gettimezone()); system.out.println(dateformat.format(cal.gettime()));