Link to home
Start Free TrialLog in
Avatar of Squadless
Squadless

asked on

Time format JAVA

Hi,
i have a question ...

String DATE_FORMAT = "yyyy-MM-dd hh:mm:ss";

java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(DATE_FORMAT);
Calendar c1 = Calendar.getInstance();

c1.set(Integer.parseInt(cYear), Integer.parseInt(cMonth)-1, Integer.parseInt(cDate), Integer.parseInt(cHour), Integer.parseInt(cMinute), Integer.parseInt(cSecond));
System.out.println(sdf.format(c1.getTime())));

the line with system out gives: 2006-10-05 08:00:11
but in reality it should be :  2006-10-05 20:00:11
How can i tell it to use military time?
Please help,
Thank you
ASKER CERTIFIED SOLUTION
Avatar of hoomanv
hoomanv
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Squadless
Squadless

ASKER

LIFE SAVER MAN, thanks a lot...u seem to be answering lot of my questions...keep it up and when i get a raise ill buy you a house :)