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())); 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -