user2371751
user2371751

Reputation: 1

Java Time/Date format

Simple question it's night here and I don't want to wait till morning

At 6AM:

SimpleDateFormat sdf = new SimpleDateFormat("HH");

Will sdf be 06, or just 6

Thanks.

Upvotes: 0

Views: 748

Answers (2)

Make
Make

Reputation: 422

You can use this SimpleDateFormat sdf; sdf = new SimpleDateFormat("hh:mm:ss"); and use 06 instead of 6

Upvotes: 0

o.o
o.o

Reputation: 143

It will be 06, not 6.

have a look at this if you need more help on the date/time format

http://www.tutorialspoint.com/java/java_date_time.htm

Hope this helps!

Upvotes: 1

Related Questions