wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Format hour and minute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Format hour and minute" Watch "Format hour and minute" New topic

Format hour and minute

Manuel Leiria
Ranch Hand

Joined: Jul 13, 2007
Posts: 171

I have,

which give me something like this: 3:44
but I want to get 15:44
What should I do?

thanks in advance,

Manuel Leiria<br /> <br />--------------<br />Peace cannot be kept by force; it can only be achieved by understanding. <br /> Albert Einstein
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60071

Check out java.text.SimpleDateFormat

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 36566
Or go through the Calendar class; there is HOUR and HOUR_OF_DAY; that might help you.
Manuel Leiria
Ranch Hand

Joined: Jul 13, 2007
Posts: 171
Got it!

I agree. Here's the link: http://aspose.com/file-tools
subject: Format hour and minute
Similar Threads
how to get the current date
Date Formatting Help
Calendar returns wrong date?
About protect method
Get date/time in a timezone corresponding to local time