File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Format hour and minute" Watch "Format hour and minute" New topic
Author

Format hour and minute

Manuel Leiria
Ranch Hand

Joined: Jul 13, 2007
Posts: 171
Hi,

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
Marshal

Joined: Jan 10, 2002
Posts: 61206
    
  66

Check out java.text.SimpleDateFormat


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

Joined: Oct 13, 2005
Posts: 38818
    
  23
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!

Thanks,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Format hour and minute