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

Get hour from specify time

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
Kennywen
Asked:
Kennywen
1 Solution
 
objectsCommented:
Calendar c = Calendar.getInstance();
c.setTime(time);
int h = c.get(Calendar.HOUR);
0
 
KennywenAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

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.

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