Solved

Get hour from specify time

Posted on 2004-04-08
2
226 Views
Last Modified: 2010-03-31
My code:

Time currentTime = null;

then i will set the time to a value, then how can i get the hour of the time?

thanks
0
Comment
Question by:Kennywen
2 Comments
 
LVL 92

Accepted Solution

by:
objects earned 25 total points
ID: 10781765
Calendar c = Calendar.getInstance();
c.setTime(time);
int h = c.get(Calendar.HOUR);
0
 

Author Comment

by:Kennywen
ID: 10781792
Object can u help me to view on my existing question:

http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_20947248.html

thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Android studio getdrawable(int) is deprecated 4 114
by zero exception 10 52
Eclipse Help Java EE 5,6,7 Documentation, why not Java EE 8 8 30
hashmap order 17 36
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This video teaches viewers about errors in exception handling.

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question