• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 215
  • Last Modified:

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
0
Squadless
Asked:
Squadless
  • 2
1 Solution
 
hoomanvCommented:
use HH instead of hh
0
 
SquadlessAuthor Commented:
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 :)
0
 
hoomanvCommented:
:)
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now